Exemple #1
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected void PageSave()
        {
            //获取form参数
            string Code      = Utils.GetFormValue("txtCode");                      //合同编码
            int    ConType   = Utils.GetInt(Utils.GetFormValue("ddlConType"), -1); //合同类型
            int    txtNumber = Utils.GetInt(Utils.GetFormValue("txtNumber"));      //合同序号
            string errorMsg  = "";

            //数据验证开始
            if (string.IsNullOrEmpty(Code.Trim()))
            {
                errorMsg = "合同编码不能为空!";
            }
            if (ConType < 0)
            {
                errorMsg = "合同类型必须选择!";
            }
            if (txtNumber <= 0)
            {
                errorMsg = "合同序号必须大于零!";
            }
            //数据验证结束

            EyouSoft.BLL.ConStructure.BContractNum bll = new EyouSoft.BLL.ConStructure.BContractNum();
            int result = 0;

            if (errorMsg == "")
            {
                //MContractDestroy model = new MContractDestroy();
                //model.Code = Code;
                //model.Index = txtNumber;
                //model.IssueTime = DateTime.Now;
                //model.OperatorId = this.SiteUserInfo.UserId;
                //result = bll.AddContractDestroy(model, ConType);
                if (result == 1)
                {
                    Utils.ShowMsgAndCloseBoxy("销毁合同号成功!", Utils.GetQueryStringValue("IframeId"), true);
                }
                else if (result == 2)
                {
                    EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('销毁合同号失败!合同号已经被销毁!');");
                }
                else if (result == 3)
                {
                    EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('销毁合同号失败!编码或序号不存在!');");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('销毁合同号失败!请检查输入的合同号');");
                }
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('销毁合同号失败!" + errorMsg + "');");
            }
        }
 /// <summary>
 /// 初始化
 /// </summary>
 private void DataInit()
 {
     //获取分页参数并强转
     pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"));
     EyouSoft.BLL.ConStructure.BContractNum BLL = new EyouSoft.BLL.ConStructure.BContractNum();
     //IList<EyouSoft.Model.ConStructure.MContractNumCollar> list = BLL.GetContractNumCollarList(Utils.GetQueryStringValue("id"), this.pageSize, this.pageIndex, ref recordCount, ref pageCount);
     //if (null != list && list.Count > 0)
     //{
     //    this.RepList.DataSource = list;
     //    this.RepList.DataBind();
     //    BindPage();
     //}
     //else
     //{
     //    this.RepList.Controls.Add(new Label() { Text = "<tr><td colspan='8' align='center'>对不起,没有相关数据!</td></tr>" });
     //    this.ExporPageInfoSelect1.Visible = false;
     //}
 }
Exemple #3
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected void PageSave(string id, string code)
        {
            //获取form参数
            int      Dept          = Utils.GetInt(this.SelectSection1.SectionID, -1);                //部门
            string   CollarId      = this.SellsSelect1.SellsID;                                      //领用人
            DateTime?txtCollarTime = Utils.GetDateTimeNullable(Utils.GetFormValue("txtCollarTime")); //领用时间
            int      txtConStart   = Utils.GetInt(Utils.GetFormValue("txtConStart"));                //开始号
            int      txtConEnd     = Utils.GetInt(Utils.GetFormValue("txtConEnd"));                  //结束号
            string   errorMsg      = "";

            //数据验证开始
            if (Dept < 0)
            {
                errorMsg = "部门必须选择!";
            }
            if (string.IsNullOrEmpty(CollarId))
            {
                errorMsg = "领用人必须选择!";
            }
            if (txtCollarTime == null)
            {
                errorMsg = "领用时间必须选择!";
            }
            if (txtConStart <= 0 || txtConEnd <= 0 || txtConStart > txtConEnd)
            {
                errorMsg = "开始号和结束号必须输入大于0的值,并且结束号大于开始号!";
            }
            //数据验证结束
            if (errorMsg != "")
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('" + errorMsg + "');");
            }
            else
            {
                int result = 0;
                EyouSoft.BLL.ConStructure.BContractNum         bll   = new EyouSoft.BLL.ConStructure.BContractNum();
                EyouSoft.Model.ConStructure.MContractNumCollar Model = new MContractNumCollar();
                Model.ContractId = id;
                //Model.Code = code;
                //Model.StartNum = txtConStart;
                //Model.EndNum = txtConEnd;
                //Model.DepartId = Dept;
                //Model.UseOperatorId = CollarId;
                //Model.OperatorId = this.SiteUserInfo.UserId;
                //Model.IssueTime = txtCollarTime == null ? DateTime.Now : Convert.ToDateTime(txtCollarTime);
                //result = bll.AddContractNumCollar(Model);
                //0添加领取成功:1超出合同号码段范围;2已存在领用号码段部分;3添加失败
                if (result == 0)
                {
                    Utils.ShowMsgAndCloseBoxy("合同号领取成功成功!", Utils.GetQueryStringValue("IframeId"), true);
                }
                else if (result == 1)
                {
                    EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('超出合同号码段范围!');");
                }
                else if (result == 2)
                {
                    EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('已存在领用号码段部分!');");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('领用号码段失败!');");
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected void PageSave()
        {
            //获取form参数
            string Code     = Utils.GetFormValue("txtCode");                      //合同编码
            int    ConType  = Utils.GetInt(Utils.GetFormValue("ddlConType"), -1); //合同类型
            string errorMsg = "";

            //数据验证开始
            if (string.IsNullOrEmpty(Code.Trim()))
            {
                errorMsg = "合同编码不能为空!";
            }
            if (ConType < 0)
            {
                errorMsg = "合同类型必须选择!";
            }
            //数据验证结束

            EyouSoft.BLL.ConStructure.BContractNum bll = new EyouSoft.BLL.ConStructure.BContractNum();
            int result = 0;

            //string errorMsg = "";

            //开始号
            string[] StartNum = Utils.GetFormValues("txtConStart");
            //结束号
            string[] EndNum = Utils.GetFormValues("txtConEnd");
            if (StartNum.Length > 0 && EndNum.Length > 0 && StartNum.Length == EndNum.Length)
            {
                List <EyouSoft.Model.ConStructure.MContractNum> list     = new List <EyouSoft.Model.ConStructure.MContractNum>();
                EyouSoft.Model.ConStructure.MContractNum        ConModel = null;
                for (int i = 0; i < StartNum.Length; i++)
                {
                    if (StartNum[i].Trim() == "" || EndNum[i].Trim() == "")
                    {
                        errorMsg += "第" + (i + 1).ToString() + "行开始号或结束号不能为空! &nbsp;";
                    }
                    else
                    {
                        if (Utils.GetInt(StartNum[i].Trim()) >= Utils.GetInt(EndNum[i].Trim()))
                        {
                            errorMsg += "第" + (i + 1).ToString() + "行开始号大于或等于结束号! &nbsp;";
                        }
                        else
                        {
                            if (i > 0 && Utils.GetInt(EndNum[i - 1].Trim()) >= Utils.GetInt(EndNum[i].Trim()))
                            {
                                errorMsg += "第" + (i + 1).ToString() + "行号码段与第" + (i).ToString() + "行号码段有重合或小于! &nbsp;";
                            }
                            //ConModel = new EyouSoft.Model.ConStructure.MContractNum();
                            //ConModel.Code = Code;
                            //ConModel.CompanyId = this.SiteUserInfo.CompanyId;
                            //ConModel.ContractType = (EyouSoft.Model.EnumType.ConStructure.ContractType)ConType;
                            //ConModel.StartNum = Utils.GetInt(StartNum[i].Trim());
                            //ConModel.EndNum = Utils.GetInt(EndNum[i].Trim());
                            //ConModel.IssueTime = DateTime.Now;
                            //ConModel.OperatorId = this.SiteUserInfo.UserId;
                            list.Add(ConModel);
                        }
                    }
                    ConModel = null;
                }
                if (list.Count > 0 && errorMsg == "")
                {
                    result = bll.AddContractNum(list);
                    if (result == 1)
                    {
                        Utils.ShowMsgAndCloseBoxy("登记合同号成功!", Utils.GetQueryStringValue("IframeId"), true);
                        //EyouSoft.Common.Function.MessageBox.ResponseScript(this, "tableToolbar._showMsg('登记合同号成功!');");
                    }
                    else if (result > 1)
                    {
                        EyouSoft.Common.Function.MessageBox.ResponseScript(this, "tableToolbar._showMsg('登记合同号段失败!合同号段有重复!');");
                    }
                    else
                    {
                        EyouSoft.Common.Function.MessageBox.ResponseScript(this, "tableToolbar._showMsg('登记合同号段失败!请检查输入的合同号段');");
                    }
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ResponseScript(this, "tableToolbar._showMsg('登记合同号段失败!" + errorMsg + "');");
                }
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "tableToolbar._showMsg('登记合同号段失败!请检查输入的合同号段');");
            }
        }