Skip to content

Commit

Permalink
Added some functions
Browse files Browse the repository at this point in the history
* Get the content of a paper
* Get the answer sheet of someone
* Get user information
  • Loading branch information
ProfFan committed Apr 30, 2014
1 parent 72052ab commit 0df8f01
Show file tree
Hide file tree
Showing 25 changed files with 58,238 additions and 78 deletions.
80 changes: 80 additions & 0 deletions PhysicsExprHelper.Interop/ExamSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,85 @@ public static BizService.SvcResponse findPaperContentByPaperID(string paperID)
return res;

}

public static BizService.SvcResponse findExamScoreByStudentIDNew(string studentID)
{

BizService.BizServiceClient svcRef = new BizService.BizServiceClient();
BizService.SvcRequest req = new BizService.SvcRequest();
BizService.DoServiceRequest doSvcRequest;

req = new BizService.SvcRequest()
{
BizCode = "USTCORi.ExamSystem.BLL.BLLExamCritique",
EnableCache = false,
MethodName = "FindExamScoreByStudentIDNew"
};
req.Parameters = new Dictionary<string, object>();
req.Parameters.Add("studentID", "\""+studentID+"\"");
BizService.SvcResponse res;
doSvcRequest = new BizService.DoServiceRequest(req);

res = svcRef.DoService(doSvcRequest).DoServiceResult;



return res;

}

public static BizService.SvcResponse findPaperContent(string examID, string studentID)
{

BizService.BizServiceClient svcRef = new BizService.BizServiceClient();
BizService.SvcRequest req = new BizService.SvcRequest();
BizService.DoServiceRequest doSvcRequest;

req = new BizService.SvcRequest()
{
BizCode = "USTCORi.ExamSystem.BLL.BLLExamCritique",
EnableCache = false,
MethodName = "FindPaperContent"
};
req.Parameters = new Dictionary<string, object>();
req.Parameters.Add("studentID", "\"" + studentID + "\"");
req.Parameters.Add("examID", examID);
BizService.SvcResponse res;
doSvcRequest = new BizService.DoServiceRequest(req);

res = svcRef.DoService(doSvcRequest).DoServiceResult;



return res;

}

public static BizService.SvcResponse findSubmitStudentByExamID(string examID)
{

BizService.BizServiceClient svcRef = new BizService.BizServiceClient();
BizService.SvcRequest req = new BizService.SvcRequest();
BizService.DoServiceRequest doSvcRequest;

req = new BizService.SvcRequest()
{
BizCode = "USTCORi.ExamSystem.BLL.BLLExamCritique",
EnableCache = false,
MethodName = "FindSubmitStudentByExamID"
};
req.Parameters = new Dictionary<string, object>();
req.Parameters.Add("examID", examID);
BizService.SvcResponse res;
doSvcRequest = new BizService.DoServiceRequest(req);

res = svcRef.DoService(doSvcRequest).DoServiceResult;



return res;

}

}
}
2 changes: 1 addition & 1 deletion PhysicsExprHelper.Interop/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IBizService" >
<binding name="BasicHttpBinding_IBizService" maxReceivedMessageSize="65535000" >
<readerQuotas maxArrayLength="65536000" maxBytesPerRead="65536000" maxStringContentLength="65536000"/>
</binding>
</basicHttpBinding>
Expand Down
202 changes: 127 additions & 75 deletions PhysicsExprHelper/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions PhysicsExprHelper/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Text;
using System.Windows.Forms;
using PhysicsExprHelper.Interop;
using System.Runtime;

namespace PhysicsExprHelper
{
Expand All @@ -31,6 +32,37 @@ private void button1_Click(object sender, EventArgs e)

}

private void btnGetPaper_Click(object sender, EventArgs e)
{
String paperID = Microsoft.VisualBasic.Interaction.InputBox("Enter Paper ID", "951");
tbLog.AppendText(Interop.ExamSystem.findPaperContentByPaperID(paperID).DataString);
}

private void btnGetExamScore_Click(object sender, EventArgs e)
{
String stuID = Microsoft.VisualBasic.Interaction.InputBox("Enter Student ID", "951");
tbLog.AppendText(Interop.ExamSystem.findExamScoreByStudentIDNew(stuID).DataString);
}

private void btnGetPaperContent_Click(object sender, EventArgs e)
{
String stuID = Microsoft.VisualBasic.Interaction.InputBox("Enter Student ID", "11310129");
String examID = Microsoft.VisualBasic.Interaction.InputBox("Enter Exam ID", "951");
String paperContent;
paperContent = Interop.ExamSystem.findPaperContent(examID, stuID).DataString;

if (paperContent!="null") tbLog.AppendText(Newtonsoft.Json.JsonConvert.DeserializeObject<string>(paperContent));
}

private void btnGetSubmitted_Click(object sender, EventArgs e)
{
String examID = Microsoft.VisualBasic.Interaction.InputBox("Enter Exam ID", "951");


tbLog.AppendText(Interop.ExamSystem.findSubmitStudentByExamID(examID).DataString);

}



}
Expand Down
7 changes: 7 additions & 0 deletions PhysicsExprHelper/PhysicsExprHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq" />
Expand Down Expand Up @@ -77,6 +83,7 @@
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
14 changes: 12 additions & 2 deletions PhysicsExprHelper/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
<configSections>
</configSections>
<system.serviceModel>
<bindings />
<client />
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IBizService" maxReceivedMessageSize="65536000" >
<readerQuotas maxArrayLength="65536000" maxBytesPerRead="65536000" maxStringContentLength="65536000"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://physicslab1:8002/BizService.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IBizService" contract="BizService.IBizService"
name="BasicHttpBinding_IBizService" />
</client>
</system.serviceModel>
</configuration>
4 changes: 4 additions & 0 deletions PhysicsExprHelper/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net35" />
</packages>
Binary file not shown.
Loading

0 comments on commit 0df8f01

Please sign in to comment.