本文整理汇总了C#中DBFunctions.getstudentinfoFromMetrcino方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.getstudentinfoFromMetrcino方法的具体用法?C# DBFunctions.getstudentinfoFromMetrcino怎么用?C# DBFunctions.getstudentinfoFromMetrcino使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFunctions
的用法示例。
在下文中一共展示了DBFunctions.getstudentinfoFromMetrcino方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: uplaodfile_Click
protected void uplaodfile_Click(object sender, EventArgs e)
{
if(Resultfile.FileName==null)
{
}
else
{
string filename = Path.GetFileName(Resultfile.PostedFile.FileName);
string Extension = Path.GetExtension(Resultfile.PostedFile.FileName);
long milliseconds = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) / 1000;
string orgPath = string.Empty;
orgPath = Server.MapPath("~/Admin/Temp_UploadedFiles/" + filename);
Resultfile.SaveAs(orgPath);
System.Data.DataTable dt = Import_To_Grid(orgPath, Extension, "Yes");
DBFunctions db = new DBFunctions();
int grade = 1008; //None Grade For Mid Result
foreach (System.Data.DataRow row in dt.Rows)
{
if (row[4].ToString().ToLower() != "mid")
{
if (int.Parse(row[2].ToString()) >= 90)
grade = 1;//A Grade
else if (int.Parse(row[2].ToString()) >= 85 && int.Parse(row[2].ToString()) < 90)
grade = 2;//A- Grade
else if (int.Parse(row[2].ToString()) >= 80 && int.Parse(row[2].ToString()) < 85)
grade = 3;//B+ Grade
else if (int.Parse(row[2].ToString()) >= 70 && int.Parse(row[2].ToString()) < 80)
grade = 4;//B Grade
else if (int.Parse(row[2].ToString()) >= 60 && int.Parse(row[2].ToString()) < 70)
grade = 5;//B- Grade
else if (int.Parse(row[2].ToString()) >= 55 && int.Parse(row[2].ToString()) < 60)
grade = 6;//C+ Grade
else if (int.Parse(row[2].ToString()) >= 50 && int.Parse(row[2].ToString()) < 55)
grade = 7;//C Grade
else if (int.Parse(row[2].ToString()) >= 45 && int.Parse(row[2].ToString()) < 50)
grade = 8;
else if (int.Parse(row[2].ToString()) < 45)
grade = 9; //F Grade
}
Results_tbl result = new Results_tbl { CourseID = int.Parse(DropDownCourse.SelectedValue), MetricNo = row[0].ToString(), TotalMarks = int.Parse(row[1].ToString()), ObtainedMarks = int.Parse(row[2].ToString()), Year = row[3].ToString(), ExamType = row[4].ToString(), Semester = int.Parse(row[5].ToString()),GradeID=grade};
//string marks = row[0].ToString();
db.addresults(result);
LabelUpload.Text = "Result Uploaded.";
LabelUpload.Visible = true;
AddmissionList_tbl student= db.getstudentinfoFromMetrcino(result.MetricNo);
if(grade!=9)
{
db.updateenrollment(student.UserID.Value, result.CourseID.Value,2); //Pass
}
else
{
db.updateenrollment(student.UserID.Value, result.CourseID.Value, 3); //Fail
}
}
}
}