コード例 #1
0
 protected void bAddProfessLvl_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.ParentCode pct = CY.GFive.Core.Business.ParentCode.GetInstance("ProfessLvl");
         if (pct == null)
         {
             CY.GFive.Core.Business.ParentCode pc = new CY.GFive.Core.Business.ParentCode();
             pc.Des = "专业级别";
             pc.PCateCode = "ProfessLvl";
             pc.PName = "ProfessLvl";
             pc.Save();
         }
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.CateName = txtProfessLvlName.Text;
         ncc.CateDes = txtProfessLvlName.Text;
         ncc.Code = txtProfessLvlCode.Text;
         ncc.ParentCode = "ProfessLvl";
         ncc.Save();
         txtProfessLvlCode.Text = "";
         txtProfessLvlName.Text = "";
         BindProfessLev();
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
コード例 #2
0
 protected void bAdmissTypeCode_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.ParentCode pct = CY.GFive.Core.Business.ParentCode.GetInstance("AdmissType");
         if (pct == null)
         {
             CY.GFive.Core.Business.ParentCode pc = new CY.GFive.Core.Business.ParentCode();
             pc.Des = "招生类型";
             pc.PCateCode = "AdmissType";
             pc.PName = "AdmissType";
             pc.Save();
         }
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.CateName = txtAdmissTypeCodeName.Text;
         ncc.CateDes = txtAdmissTypeCodeName.Text;
         ncc.Code = txtAdmissTypeCodeCode.Text;
         ncc.ParentCode = "AdmissType";
         ncc.Save();
         txtAdmissTypeCodeCode.Text = "";
         txtAdmissTypeCodeName.Text = "";
         BindAdmissType();
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
コード例 #3
0
 protected void BtnCate_Click(object sender, EventArgs e)
 {
     errormsg.Text = "";
     try
     {
         CY.GFive.Core.Business.CateCode c = CY.GFive.Core.Business.CateCode.GetByParAndCode(catecode.Text.Trim(),"StaffCate");
         if (c == null)
         {
             CY.GFive.Core.Business.CateCode cc = new CY.GFive.Core.Business.CateCode();
             cc.Code = catecode.Text.Trim();
             cc.CateName = catename.Text.Trim();
             cc.CateDes = catedes.Text.Trim();
             cc.ParentCode = "StaffCate";
             cc.Save();
             staffCate_DataBind();
         }
         else
         {
             errormsg.Text = "该类型已经存在,请核对编号";
         }
     }
     catch (Exception ex)
     {
         errormsg.Text = ex.Message;
     }
 }
コード例 #4
0
 protected void bAddEntCate_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.ParentCode pct = CY.GFive.Core.Business.ParentCode.GetInstance("EnterpriseCate");
         if (pct == null)
         {
             CY.GFive.Core.Business.ParentCode pc = new CY.GFive.Core.Business.ParentCode();
             pc.Des = "企业类型";
             pc.PCateCode = "EnterpriseCate";
             pc.PName = "EnterpriseCate";
             pc.Save();
         }
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.CateName = txtAddEntCateName.Text;
         ncc.Code = txtAddEntCateCode.Text.Trim();
         CY.GFive.Core.Business.CateCode anycc = CY.GFive.Core.Business.CateCode.GetInstance(txtAddEntCateCode.Text.Trim());
         if (anycc != null)
         {
             ErrorMsg.Text = "错误,已存在相同的类型码!";
             return;
         }
         ncc.CateDes = txtAddEntCateName.Text;
         ncc.ParentCode = "EnterpriseCate";
         ncc.Save();
         txtAddEntCateName.Text = "";
         txtAddEntCateCode.Text = "";
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message.ToString();
     }
     BindEnterpriseCate();
 }
コード例 #5
0
        private string HandlerData(HttpContext context)
        {
            string Code = context.Request.Params["code"];
            string Name = context.Request.Params["name"];
            string Des = context.Request.Params["des"];
            string ParentCode = context.Request.Params["parent"];

            StringBuilder returnvalue = new StringBuilder();
            returnvalue.Append("{");
            try
            {
                bool issave=true;
                if (string.IsNullOrEmpty(Code) || CY.GFive.Core.Business.CateCode.IsExist(Code) || string.IsNullOrEmpty(Name)
                    || CY.GFive.Core.Business.CateCode.IsExistName(Name))
                {
                    returnvalue.Append("result: true");
                    issave=false;
                }
                else
                {
                    returnvalue.Append("result: false");
                    issave=true;
                }

                if (issave)
                {
                    CY.GFive.Core.Business.CateCode cateCode = new CY.GFive.Core.Business.CateCode();
                    cateCode.CateDes = Des;
                    cateCode.CateName = Name;
                    cateCode.Code = Code;
                    cateCode.ParentCode = ParentCode;
                    cateCode.Save();

                    returnvalue.Append(",Code:'" + Code + "'");
                    returnvalue.Append(",Name:'" + Name + "'");
                    returnvalue.Append(",Des:'" + Des + "'");

                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                returnvalue.Append("}");
            }
            return returnvalue.ToString();
        }
コード例 #6
0
 protected void btxtStdStatus_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.CateName = txtStdStatusName.Text;
         ncc.CateDes = txtStdStatusName.Text;
         ncc.Code = txtStdStatusCode.Text;
         ncc.ParentCode = "StdState";
         ncc.Save();
         txtStdStatusCode.Text = "";
         txtStdStatusName.Text = "";
         BindStdStatus();
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
コード例 #7
0
 protected void btxtStdStatus_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.ParentCode pct = CY.GFive.Core.Business.ParentCode.GetInstance("StdState");
         if (pct == null)
         {
             CY.GFive.Core.Business.ParentCode pc = new CY.GFive.Core.Business.ParentCode();
             pc.Des = "学生状态";
             pc.PCateCode = "StdState";
             pc.PName = "StdState";
             pc.Save();
         }
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.CateName = txtStdStatusName.Text;
         ncc.CateDes = txtStdStatusName.Text;
         ncc.Code = txtStdStatusCode.Text;
         ncc.ParentCode = "StdState";
         ncc.Save();
         txtStdStatusCode.Text = "";
         txtStdStatusName.Text = "";
         BindStdStatus();
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
コード例 #8
0
 protected void bYearNum_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.ParentCode pct = CY.GFive.Core.Business.ParentCode.GetInstance("YearNum");
         if (pct == null)
         {
             CY.GFive.Core.Business.ParentCode pc = new CY.GFive.Core.Business.ParentCode();
             pc.Des = "年级";
             pc.PCateCode = "YearNum";
             pc.PName = "YearNum";
             pc.Save();
         }
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.CateName = txtYearNumName.Text;
         ncc.CateDes = txtYearNumName.Text;
         ncc.Code = txtYearNumCode.Text;
         ncc.ParentCode = "YearNum";
         ncc.Save();
         txtYearNumCode.Text = "";
         txtYearNumName.Text = "";
         BindYearNum();
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
コード例 #9
0
 protected void bYearNum_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.CateName = txtYearNumName.Text;
         ncc.CateDes = txtYearNumName.Text;
         ncc.Code = txtYearNumCode.Text;
         ncc.ParentCode = "YearNum";
         ncc.Save();
         txtYearNumCode.Text = "";
         txtYearNumName.Text = "";
         BindYearNum();
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
コード例 #10
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.ParentCode pct = CY.GFive.Core.Business.ParentCode.GetInstance("EmployCate");
         if (pct == null)
         {
             CY.GFive.Core.Business.ParentCode pc = new CY.GFive.Core.Business.ParentCode();
             pc.Des = "就业类型";
             pc.PCateCode = "EmployCate";
             pc.PName = "EmployCate";
             pc.Save();
         }
         CY.GFive.Core.Business.CateCode ncc = new CY.GFive.Core.Business.CateCode();
         ncc.Code = txtEmployCateCode.Text.Trim();
         ncc.CateName = txtEmployCateName.Text.Trim();
         ncc.CateDes = txtEmployCateName.Text.Trim();
         ncc.ParentCode = "EmployCate";
         ncc.Save();
         BindEmployCate();
         txtEmployCateName.Text = "";
         txtEmployCateCode.Text = "";
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
コード例 #11
0
 /// <summary>
 /// OK
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btn_Add_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(this.tb_Code.Text) || String.IsNullOrEmpty(this.tb_Name.Text))
     {
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('类别代码和类别名称不能为空!');</script>");
         return;
     }
     bool issuecess = false;
     if (IsValidate)
     {
         CY.GFive.Core.Business.CateCode cate = new CY.GFive.Core.Business.CateCode();
         cate.Code = tb_Code.Text.Trim();
         cate.CateName = tb_Name.Text.Trim();
         cate.CateDes = tb_Name.Text.Trim();
         cate.ParentCode = QueryStringCode;
         cate.Save();
         issuecess = true;
     }
     if (issuecess)
     {
         GridView_DataBind();
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('添加成功!');</script>");
         return;
     }
     else
     {
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('查询字符串错误!');</script>");
         return;
     }
 }