Пример #1
0
        //删除
        protected void lbtJudgeDelete_Click(object sender, EventArgs e)
        {
            BLL.CCOM.Judge bll  = new BLL.CCOM.Judge();
            var            lbtn = sender as LinkButton;

            if (lbtn != null)
            {
                var  id     = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString()));
                bool result = true;
                try
                {
                    result = bll.Delete(id);
                }
                catch
                {
                    result = false;
                }
                string keywords = this.keywordTab0;
                int    page     = MyRequest.GetQueryInt("page", 1);
                if (result == true)
                {
                    JscriptMsg("删除成功!", Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}",
                                                         DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Success");
                }
                else
                {
                    JscriptMsg("删除失败!", Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}",
                                                         DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Error");
                }
            }
        }
Пример #2
0
        //tab2===================
        #region 数据绑定=================================
        private void JudgeBind(string _strWhere, string _order)
        {
            int pageSize = JudgeGetPageSize(15); //每页数量
            int page     = MyRequest.GetQueryInt("page", 1);
            //string keywords = MyRequest.GetQueryString("keywords");
            string keywords    = this.keywordTab0;
            int    start_index = pageSize * (page - 1) + 1;
            int    end_index   = pageSize * page;

            this.txtKeywords.Text = keywords;

            var bll = new BLL.CCOM.Judge();
            //计算数量
            int totalCount = bll.GetRecordCount(_strWhere);

            //绑定当页
            this.Repeater1.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index);
            this.Repeater1.DataBind();

            //绑定页码
            txtJudgePageNum.Text = pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, "__id__");

            this.Div2.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true);
        }
        protected string getJudgeName(string _judge_id)
        {
            string strWhere = " Judge_id=" + _judge_id;

            Model.CCOM.Judge judge = new BLL.CCOM.Judge().GetModel(strWhere);
            string           name  = "";

            if (judge != null)
            {
                name = judge.Judge_name;
            }
            return(name);
        }
        private void RalBind()
        {
            try
            {
                var modelList = new BLL.CCOM.Judge().GetModelList("");

                if (modelList.Count > 0)
                {
                    foreach (Model.CCOM.Judge judge in modelList)
                    {
                        ListItem item = new ListItem();
                        item.Text  = judge.Judge_name.ToString() + " # " + judge.Judge_staff_number;
                        item.Value = judge.Judge_id.ToString();
                        this.ddlJudge_ID.Items.Add(item);
                    }
                }
                ListItem item1 = new ListItem("--请选择评委--", "#");
                this.ddlJudge_ID.Items.Insert(0, item1);


                var examList = new BLL.CCOM.View_AEE_ManegeSubject().GetModelList(" Period_id = " + period_id + " AND User_id=" + user_id + " order by Ea_id asc");
                if (examList.Count > 0)
                {
                    int Ea_id = 0;
                    foreach (Model.CCOM.View_AEE_ManegeSubject exam in examList)
                    {
                        int _Ea_id = exam.Ea_id;
                        if (Ea_id != _Ea_id)
                        {
                            Ea_id = _Ea_id;

                            var exam_detail = new BLL.CCOM.Examination_arrangement().GetModel(Ea_id);

                            ListItem item = new ListItem();
                            item.Text  = exam_detail.Ea_name.ToString();
                            item.Value = exam_detail.Ea_id.ToString();

                            this.ddlExam.Items.Add(item);
                        }
                    }
                }
                ListItem item2 = new ListItem("--请选择考试--", "#");
                this.ddlExam.Items.Insert(0, item2);
            }
            catch
            {
                JscriptMsg("数据出错", "", "Error");
            }
        }
Пример #5
0
 protected void BindSignInfo(long signId)
 {
     Model.CCOM.Judge model = new BLL.CCOM.Judge().GetModel(" Judge_id=" + signId);
     if (model != null)
     {
         this.nameText.Text  = model.Judge_name;
         this.staffText.Text = model.Judge_staff_number;
         this.depText.Text   = model.Judge_department;
         this.titleText.Text = model.Judge_title;
     }
     else
     {
         JscriptMsg("传输参数不正确!", "back", "Error");
     }
 }
        private void RptBind()
        {
            BLL.CCOM.Judge Bj = new BLL.CCOM.Judge();
            DataSet        ds = Bj.GetList("");

            this.ddlJudge.DataSource     = ds.Tables[0].DefaultView;
            this.ddlJudge.DataTextField  = "Judge_name";
            this.ddlJudge.DataValueField = "Judge_id";
            this.ddlJudge.DataBind();

            string order    = "UP_CCOM_number asc";
            string strWhere = CombSqlTxt(this.keywords);

            this.ddlJudge.SelectedValue = judge_id;
            try
            {
                RptBind(strWhere, order);
            }
            catch
            {
                JscriptMsg("获取考生成绩出错", "", "Error");
            }
        }
Пример #7
0
        protected string ImportDataItem(DataSet ds, ref int success, ref int error)//基础数据
        {
            string result = "";

            BLL.CCOM.Judge   bll   = new BLL.CCOM.Judge();
            Model.CCOM.Judge model = new Model.CCOM.Judge();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string checkmsg = null;
                string name     = ds.Tables[0].Rows[i]["姓名"].ToString().Trim();
                if (!ValidDFValue(name, true, "", ref checkmsg))
                {
                    result += "×第" + (i + 1).ToString() + "行数据更新失败,姓名" + checkmsg + "<br/>";
                    error++;
                    continue;
                }
                else if (name != "")
                {
                    model.Judge_name = name;
                }

                string staff = ds.Tables[0].Rows[i]["教工号"].ToString().Trim();
                if (!ValidDFValue(staff, true, "", ref checkmsg))
                {
                    result += "×第" + (i + 1).ToString() + "行数据更新失败,教工号" + checkmsg + "<br/>";
                    error++;
                    continue;
                }
                else if (staff != "")
                {
                    model.Judge_staff_number = staff;
                }

                string dep = ds.Tables[0].Rows[i]["所属部门"].ToString().Trim();
                if (!ValidDFValue(dep, true, "", ref checkmsg))
                {
                    result += "×第" + (i + 1).ToString() + "行数据更新失败,所属部门" + checkmsg + "<br/>";
                    error++;
                    continue;
                }
                else if (dep != "")
                {
                    model.Judge_department = dep;
                }

                string title = ds.Tables[0].Rows[i]["职称"].ToString().Trim();
                if (!ValidDFValue(title, true, "", ref checkmsg))
                {
                    result += "×第" + (i + 1).ToString() + "行数据更新失败,职称" + checkmsg + "<br/>";
                    error++;
                    continue;
                }
                else if (title != "")
                {
                    model.Judge_title = title;
                }

                if (bll.Add(model) == 0)
                {
                    result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>";
                    error++;
                    continue;
                }
                else
                {
                    success++;
                }
            }
            return(result);
        }
Пример #8
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            String name  = this.nameText.Text;
            String staff = this.staffText.Text;
            String dep   = this.depText.Text;
            String title = this.titleText.Text;

            if (name == "")
            {
                JscriptMsg("评委姓名不能为空!", "", "Error");
                return;
            }
            if (staff == "")
            {
                JscriptMsg("教工号不能为空!", "", "Error");
                return;
            }
            if (dep == "")
            {
                JscriptMsg("所属部门不能为空!", "", "Error");
                return;
            }
            if (title == "")
            {
                JscriptMsg("职称不能为空!", "", "Error");
                return;
            }
            if (Tools.CheckParams(name))
            {
                JscriptMsg("评委姓名不合法!", "", "Error");
                return;
            }
            if (Tools.CheckParams(staff))
            {
                JscriptMsg("教工号不合法!", "", "Error");
                return;
            }
            if (Tools.CheckParams(dep))
            {
                JscriptMsg("所属部门不合法!", "", "Error");
                return;
            }
            if (Tools.CheckParams(title))
            {
                JscriptMsg("评委职称不合法!", "", "Error");
                return;
            }

            if (action == MyEnums.ActionEnum.Edit.ToString()) //修改
            {
                if (signId != 0)
                {
                    Model.CCOM.Judge model = new BLL.CCOM.Judge().GetModel(" Judge_id=" + signId);
                    if (model != null)
                    {
                        model.Judge_name         = name;
                        model.Judge_staff_number = staff;
                        model.Judge_department   = dep;
                        model.Judge_title        = title;
                        if (new BLL.CCOM.Judge().Update(model))
                        {
                            string pageUrl = Utils.CombUrlTxt("JudgeList.aspx", "fun_id={0}",
                                                              DESEncrypt.Encrypt(this.fun_id));
                            JscriptMsg("评委信息编辑成功!^_^", pageUrl, "Success");
                        }
                        else
                        {
                            JscriptMsg("出现异常,评委信息编辑失败!", "", "Error");
                        }
                    }
                }
            }
            else
            {
                //add
                Model.CCOM.Judge model = new Model.CCOM.Judge();
                model.Judge_name         = name;
                model.Judge_staff_number = staff;
                model.Judge_department   = dep;
                model.Judge_title        = title;
                model.Judge_id           = new BLL.CCOM.Judge().Add(model);
                if (model.Judge_id > 0)
                {
                    string pageUrl = Utils.CombUrlTxt("JudgeList.aspx", "fun_id={0}",
                                                      DESEncrypt.Encrypt(this.fun_id));
                    JscriptMsg("添加评委成功!^_^", pageUrl, "Success");
                }
                else
                {
                    JscriptMsg("出现异常,添加评委失败!", "", "Error");
                }
            }
        }