示例#1
0
        protected void ddlMajor_SelectedIndexChanged(object sender, EventArgs e)
        {
            string str1   = " Agency_id=" + major_id + " AND Period_id=" + period_id + " AND UP_calculation_status > 2";
            var    model1 = new BLL.CCOM.User_property().GetModelList(str1);

            if (model1.Count > 0)
            {
                hasRetrial = false;
            }
            this.btnCalculation.Enabled = hasRetrial;

            string order    = "";
            string strWhere = " Major_id=" + major_id + " AND Period_id=" + period_id;

            BLL.CCOM.Exam_preliminary_subject bll = new BLL.CCOM.Exam_preliminary_subject();
            var epsmodel = bll.GetModel(strWhere);

            if (epsmodel != null)
            {
                int Esn_id = epsmodel.Esn_id;
                subList = new BLL.CCOM.Subject().GetModelList(" Fs_id=" + Esn_id);
                count   = subList.Count;
            }

            order    = "Epss_score DESC, Epss_sequence DESC ,UP_CCOM_number asc";
            strWhere = CombSqlTxt(this.keywords);
            try
            {
                RptBind(strWhere, order);
            }
            catch
            {
                JscriptMsg("获取考生成绩出错", "", "Error");
            }
        }
示例#2
0
        public bool addPreliminary(string major, string subject_id)
        {
            try
            {
                string strWhere = " Major_id=" + major + " AND Period_id=" + this.period_id;
                BLL.CCOM.Exam_preliminary_subject bll = new BLL.CCOM.Exam_preliminary_subject();
                var model  = bll.GetModel(strWhere);
                var _model = new Model.CCOM.Exam_preliminary_subject();

                if (model == null)
                {
                    _model.Esn_id    = Convert.ToInt32(subject_id);
                    _model.Major_id  = Convert.ToInt32(major);
                    _model.Period_id = this.period_id;
                    bll.Add(_model);
                }
                else
                {
                    model.Esn_id = Convert.ToInt32(subject_id);
                    bll.Update(model);
                }
                return(true);
            }
            catch
            {
                JscriptMsg("数据出错", "", "Error");
                return(false);
            }
        }
示例#3
0
        private void RalBind()
        {
            try
            {
                string order    = "";
                string strWhere = " Major_id=" + major_id + " AND Period_id=" + period_id;

                BLL.CCOM.Exam_preliminary_subject bll = new BLL.CCOM.Exam_preliminary_subject();
                var epsmodel = bll.GetModel(strWhere);

                if (epsmodel != null)
                {
                    int Esn_id = epsmodel.Esn_id;
                    subList = new BLL.CCOM.Subject().GetModelList(" Fs_id=" + Esn_id);
                    count   = subList.Count;
                }

                order    = "Epss_score DESC, Epss_sequence DESC ,UP_CCOM_number asc";
                strWhere = CombSqlTxt(this.keywords);
                try
                {
                    RptBind(strWhere, order);
                }
                catch
                {
                    JscriptMsg("获取考生成绩出错", "", "Error");
                }
            }
            catch
            {
                JscriptMsg("数据出错", "", "Error");
            }
        }
示例#4
0
        protected void ddlMajor_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.radioSub.Items.Clear();
            if (this.ddlClique.SelectedValue == null || this.ddlClique.SelectedValue == "#")
            {
                this.LabelExamRoom.Text = "";
                JscriptMsg("请选择系", "", "Error");
                return;
            }
            if (this.ddlMajor.SelectedValue == null || this.ddlMajor.SelectedValue == "#")
            {
                this.LabelExamRoom.Text = "";
                JscriptMsg("请选择专业方向", "", "Error");
                return;
            }

            string father_id = this.ddlMajor.SelectedValue;
            string strWhere  = " Major_Agency_id = " + father_id + " AND Subject_level=1";

            BLL.CCOM.Subject Bll = new BLL.CCOM.Subject();
            DataSet          ds  = Bll.GetList(strWhere);

            this.radioSub.DataSource     = ds.Tables[0].DefaultView;
            this.radioSub.DataTextField  = "Subject_title";
            this.radioSub.DataValueField = "Subject_id";
            this.radioSub.DataBind();

            string str    = " Major_id=" + father_id + " AND Period_id=" + period_id;
            var    model1 = new BLL.CCOM.Exam_preliminary_subject().GetModel(str);

            if (model1 != null)
            {
                this.radioSub.SelectedValue = model1.Esn_id.ToString();
                hasPreliminary = false;
            }
            this.radioSub.Enabled  = hasPreliminary;
            this.lblSubmit.Enabled = hasPreliminary;
        }
示例#5
0
        protected void exportexcel_ServerClick(object sender, EventArgs e)
        {
            string order    = "Epss_score DESC, Epss_sequence DESC ,UP_CCOM_number asc";
            string strWhere = CombSqlTxt(this.keywords);

            try
            {
                string strWhere1 = " Major_id=" + major_id + " AND Period_id=" + period_id;

                BLL.CCOM.Exam_preliminary_subject bll1 = new BLL.CCOM.Exam_preliminary_subject();
                var epsmodel = bll1.GetModel(strWhere1);

                if (epsmodel != null)
                {
                    int Esn_id = epsmodel.Esn_id;
                    subList = new BLL.CCOM.Subject().GetModelList(" Fs_id=" + Esn_id);
                    count   = subList.Count;
                }

                BLL.CCOM.View_Preliminary_Score          bll       = new BLL.CCOM.View_Preliminary_Score();
                List <Model.CCOM.View_Preliminary_Score> modelList = bll.GetModelList(strWhere + " order by " + order);

                DataSet _ds = new DataSet();
                _ds.Tables.Clear();

                DataTable  dt = _ds.Tables.Add("Sheet1");
                DataRow    dr;
                DataColumn column;

                column            = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = "序号";
                _ds.Tables["Sheet1"].Columns.Add(column);

                column            = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = "状态";
                _ds.Tables["Sheet1"].Columns.Add(column);

                column            = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = "考生号";
                _ds.Tables["Sheet1"].Columns.Add(column);

                column            = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = "姓名";
                _ds.Tables["Sheet1"].Columns.Add(column);

                if (count > 0)
                {
                    foreach (var model in subList)
                    {
                        column            = new DataColumn();
                        column.DataType   = System.Type.GetType("System.String");
                        column.ColumnName = model.Subject_title;
                        _ds.Tables["Sheet1"].Columns.Add(column);

                        column            = new DataColumn();
                        column.DataType   = System.Type.GetType("System.String");
                        column.ColumnName = model.Subject_title + "序";
                        _ds.Tables["Sheet1"].Columns.Add(column);
                    }
                }

                column            = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = "总成绩";
                _ds.Tables["Sheet1"].Columns.Add(column);

                column            = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = "总平均序";
                _ds.Tables["Sheet1"].Columns.Add(column);

                int _count = modelList.Count;
                for (int i = 0, num = 1; i < _count; i++, num++)
                {
                    dr        = _ds.Tables["Sheet1"].NewRow();
                    dr["序号"]  = num.ToString();
                    dr["状态"]  = getIntoRetrail(modelList[i].UP_calculation_status.ToString());
                    dr["姓名"]  = modelList[i].User_realname;
                    dr["考生号"] = modelList[i].UP_CCOM_number;

                    int t = 0;;
                    if (count > 0)
                    {
                        foreach (var model in subList)
                        {
                            dr[4 + t]     = getSubjectAverageScore(modelList[i].User_id.ToString(), model.Subject_id.ToString());
                            dr[4 + t + 1] = getSubjectAverageXu(modelList[i].User_id.ToString(), model.Subject_id.ToString());
                            t            += 2;
                        }
                    }

                    dr["总成绩"]  = ((decimal)(modelList[i].Epss_score)).ToString("F2");
                    dr["总平均序"] = ((decimal)modelList[i].Epss_sequence).ToString("F2");

                    _ds.Tables["Sheet1"].Rows.Add(dr);
                }
                DataToExcel.ExportToExcel(_ds, Server.MapPath("/upload/excel/"), "初试进入复试情况_" + DateTime.Now.ToFileTime().ToString() + ".xlsx", this.Page);
            }
            catch
            {
                JscriptMsg("获取初试进入复试情况出错", "", "Error");
            }
        }
示例#6
0
        public bool calPreliminary(string subject_id)
        {
            try
            {
                decimal weights     = 0;
                string  strWhere    = " Fs_id=" + subject_id;
                var     subjectList = new BLL.CCOM.Subject().GetModelList(strWhere);
                if (subjectList.Count > 0)
                {
                    foreach (var model in subjectList)
                    {
                        weights += (decimal)(model.Subject_weight);
                    }
                }

                if (weights != 0)
                {
                    strWhere = " Agency_id=" + this.ddlMajor.SelectedValue;

                    var hasSecondTry = new BLL.CCOM.User_property().GetModelList(" Agency_id=" + this.ddlMajor.SelectedValue + " AND UP_calculation_status = 2");
                    if (hasSecondTry.Count > 0)
                    {
                        strWhere += " AND UP_calculation_status > 1";
                    }
                    else
                    {
                        strWhere += " AND UP_calculation_status > 0";
                    }


                    var examineeList = new BLL.CCOM.View_GetExaminee().GetModelList(strWhere);

                    foreach (var model in examineeList)
                    {
                        long    user_id = model.User_id;
                        decimal score = 0, xu = 0;
                        int     num = 0;

                        foreach (var _model in subjectList)
                        {
                            var __model = new BLL.CCOM.Examination_subject_average_score().GetModel(" Esn_id=" + _model.Subject_id + " AND User_id=" + user_id);
                            if (__model != null)
                            {
                                num++;
                                score += (decimal)(__model.Esas_score * (_model.Subject_weight / weights));
                                if (__model.Esas_sequence != null)
                                {
                                    xu += (decimal)(__model.Esas_sequence * (_model.Subject_weight / weights));
                                }
                            }
                        }

                        if (num > 0)
                        {
                            var model1 = new BLL.CCOM.Exam_preliminary_subject().GetModel(" Esn_id=" + subject_id + " AND Major_id=" + this.major_id + " AND Period_id=" + period_id);

                            BLL.CCOM.Exam_preliminary_subject_score bll2 = new BLL.CCOM.Exam_preliminary_subject_score();
                            var model2  = bll2.GetModel(" Eps_id=" + model1.Eps_id + " AND User_id=" + user_id);
                            var _model2 = new Model.CCOM.Exam_preliminary_subject_score();

                            if (model2 != null)
                            {
                                model2.Eps_id     = model1.Eps_id;
                                model2.User_id    = user_id;
                                model2.Epss_score = score;
                                if (xu != 0)
                                {
                                    model2.Epss_sequence = xu;
                                }
                                else
                                {
                                    model2.Epss_sequence = null;
                                }
                                bll2.Update(model2);
                            }
                            else
                            {
                                _model2.Eps_id     = model1.Eps_id;
                                _model2.User_id    = user_id;
                                _model2.Epss_score = score;
                                if (xu != 0)
                                {
                                    _model2.Epss_sequence = xu;
                                }
                                else
                                {
                                    _model2.Epss_sequence = null;
                                }
                                bll2.Add(_model2);
                            }
                        }
                    }
                    JscriptMsg("设置复试科目成功", "SelectToRetrial.aspx?fun_id=" + get_fun_id("CCOM/AEEManage/SelectToRetrial.aspx"), "Success");
                    return(true);
                }
                else
                {
                    JscriptMsg("总权重为零", "", "Error");
                    return(false);
                }
            }
            catch
            {
                JscriptMsg("填加数据出错", "", "Error");
            }
            return(false);
        }