当前位置: 首页>>代码示例>>C#>>正文


C# DBFunctions.updateenrollment方法代码示例

本文整理汇总了C#中DBFunctions.updateenrollment方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.updateenrollment方法的具体用法?C# DBFunctions.updateenrollment怎么用?C# DBFunctions.updateenrollment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBFunctions的用法示例。


在下文中一共展示了DBFunctions.updateenrollment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

                }
               
            }
            

        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:65,代码来源:uploadresult.aspx.cs

示例2: Enroll

    public static string Enroll(string appid, string status)
    {

        DBFunctions db = new DBFunctions();
        db.updateenrollment(int.Parse(appid), status);
        return "ss";
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:7,代码来源:EnrollmentAppications.aspx.cs


注:本文中的DBFunctions.updateenrollment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。