Exemplo n.º 1
0
        /// <summary>
        /// 获取合同号
        /// </summary>
        void GetHeTongHao()
        {
            StringBuilder s    = new StringBuilder();
            var           info = new EyouSoft.Model.ConStructure.MAutocompleteChaXunInfo();

            info.Length     = 10;
            info.HeTongCode = Utils.GetQueryStringValue("q");
            info.HeTongId   = Utils.GetQueryStringValue("yuanhetongid");
            info.LeiXing    = null;
            info.Status     = EyouSoft.Model.EnumType.ConStructure.ContractStatus.领用;

            var items = new EyouSoft.BLL.ConStructure.BContractNum().GetAutocompleteHeTongs(CompanyId, info);

            if (items == null || items.Count == 0)
            {
                Utils.RCWE("未匹配到该合同号| ");
            }

            foreach (var item in items)
            {
                s.Append(item.ContractCode + "|" + item.ContractId + "\n");
            }

            items = null;

            Utils.RCWE(s.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 保存
        /// </summary>
        protected void PageSave()
        {
            #region 表单取值
            string msg    = "";
            bool   result = false;
            Response.Clear();
            //int type = Utils.GetQueryStringValue("type") != "1" ? 0 : 1;
            string[] ids        = Utils.GetQueryStringValue("ids").Split(',');
            string[] codes      = Utils.GetQueryStringValue("codes").Split(',');
            DateTime collarTime = Utils.GetDateTime(this.txtCollarTime.Text.Trim(), DateTime.Now);

            string useId    = Utils.GetFormValue(this.HrSelect1.HrSelectIDClient);
            int    departId = Utils.GetInt(Utils.GetFormValue(this.hideDeptID.UniqueID));
            #endregion

            #region 表单验证
            if (ids.Length < 1 || ids.Length != codes.Length)
            {
                msg += "-领用的合同号有误!";
            }
            if (string.IsNullOrEmpty(useId))
            {
                msg += "-领用人必须填写!";
            }
            if (departId == 0)
            {
                msg += "-领用部门必须填写!";
            }
            if (!string.IsNullOrEmpty(msg))
            {
                result = false;
                Response.Write("{\"result\":\"" + result + "\",\"msg\":\"" + msg + "\"}");
                Response.End();
                return;
            }
            #endregion

            #region 提交回应
            EyouSoft.BLL.ConStructure.BContractNum bll = new EyouSoft.BLL.ConStructure.BContractNum();
            int i = bll.AddContractNumCollar(this.SiteUserInfo.CompanyId, CreateListModel(ids, codes, useId, departId, collarTime));
            if (i < 0)
            {
                result = false;
                msg    = "领用失败!";
            }
            if (i == 0)
            {
                result = true;
                msg    = "领用成功!";
            }
            if (i > 0)
            {
                result = false;
                msg    = "领用合同号失败,其中有 " + i + " 条合同号领用失败!";
            }
            Response.Clear();
            Response.Write("{\"result\":\"" + result + "\",\"msg\":\"" + msg + "\"}");
            Response.End();
            #endregion
        }
Exemplo n.º 3
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void DataInit()
        {
            #region
            //合同类型
            int conType = Utils.GetInt(Utils.GetQueryStringValue("sel_conType"), -1);
            sel_conType = UtilsCommons.GetEnumDDL(EyouSoft.Common.EnumObj.GetList(typeof(EyouSoft.Model.EnumType.ConStructure.ContractType)), conType.ToString(), true);
            #endregion
            //开始号
            int ConStart = Utils.GetInt(Utils.GetQueryStringValue("txtConStart"), -1);
            //结束号
            int ConEnd = Utils.GetInt(Utils.GetQueryStringValue("txtConEnd"), -1);
            //领用人
            string SelerId   = Utils.GetQueryStringValue("ctl00_ContentPlaceHolder1_Seller1_hideSellID");
            string SelerName = Utils.GetQueryStringValue("ctl00_ContentPlaceHolder1_Seller1_txtSellName");
            if (SelerId != "" && SelerName != "")
            {
                this.Seller1.SellsID   = SelerId;
                this.Seller1.SellsName = SelerName;
            }

            //获取分页参数并强转
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"));
            EyouSoft.BLL.ConStructure.BContractNum   BLL         = new EyouSoft.BLL.ConStructure.BContractNum();
            EyouSoft.Model.ConStructure.MContractNum searchModel = null;
            if (conType >= 0 || ConStart > 0 || ConEnd > 0 || SelerId != "")
            {
                searchModel = new EyouSoft.Model.ConStructure.MContractNum();
                if (conType >= 0)
                {
                    searchModel.ContractType = (EyouSoft.Model.EnumType.ConStructure.ContractType)conType;
                }
                //if (ConStart > 0)
                //{
                //    searchModel.StartNum = ConStart;
                //}
                //if (ConEnd > 0)
                //{
                //    searchModel.EndNum = ConEnd;
                //}
                //if (SelerId != "")
                //{
                //    searchModel.UseOperatorId = SelerId;
                //}
            }
            //IList<EyouSoft.Model.ConStructure.MContractNum> list = BLL.GetContractNumList(this.SiteUserInfo.CompanyId, searchModel, this.pageSize, this.pageIndex, ref this.recordCount, ref this.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;
            //    this.ExporPageInfoSelect2.Visible = false;
            //}
        }
Exemplo n.º 4
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string[] ids)
        {
            IList <EyouSoft.Model.ConStructure.MContractNumList> list = new EyouSoft.BLL.ConStructure.BContractNum().GetContractNumList(SiteUserInfo.CompanyId, ids);

            repList.DataSource = list;
            repList.DataBind();
            //释放
            list = null;
        }
Exemplo n.º 5
0
        /// <summary>
        /// 保存
        /// </summary>
        protected void PageSave()
        {
            #region 表单取值
            string msg    = "";
            bool   result = false;
            Response.Clear();
            string prefixCode   = Utils.GetFormValue(txtPrefix.UniqueID);
            int    startCode    = Utils.GetInt(this.txtStart.Text.Trim());
            int    endCode      = Utils.GetInt(this.txtEnd.Text.Trim());
            int    xuHaoChangDu = Utils.GetInt(Utils.GetFormValue(txtXuHaoChangDu.UniqueID), 1);
            #endregion

            #region 表单验证
            if (string.IsNullOrEmpty(prefixCode))
            {
                msg += "请输入合同号前缀!<br/>";
            }
            if (startCode == 0 && endCode == 0)
            {
                msg += "请输入合同号起始序号或截止序号!<br/>";
            }
            if (startCode > 0 && endCode > 0 && System.Math.Abs(startCode - endCode) > 200)
            {
                msg += "起始序号和截止序号只能相差200!<br/>";
            }
            if (!string.IsNullOrEmpty(msg))
            {
                result = false;
                Response.Write("{\"result\":\"" + result + "\",\"msg\":\"" + msg + "\"}");
                Response.End();
                return;
            }
            #endregion

            #region 提交回应
            int i = new EyouSoft.BLL.ConStructure.BContractNum().AddContractNum(CreateListModel(prefixCode, startCode, endCode, HeTongLeiXing, xuHaoChangDu));
            if (i < 0)
            {
                result = false;
                msg    = "登记失败!";
            }
            if (i == 0)
            {
                result = true;
                msg    = "登记成功!";
            }
            if (i > 0)
            {
                result = false;
                msg    = "登记合同号失败,其中有 " + i + " 条重复!";
            }
            Response.Clear();
            Response.Write("{\"result\":\"" + result + "\",\"msg\":\"" + msg + "\"}");
            Response.End();
            #endregion
        }
Exemplo n.º 6
0
 /// <summary>
 /// 初始化
 /// </summary>
 private void DataInit()
 {
     #region 获取查询条件
     //合同号状态
     int status = Utils.GetInt(Utils.GetQueryStringValue("sltStatus"), -1);
     this.litStatue.Text = UtilsCommons.GetEnumDDL(EyouSoft.Common.EnumObj.GetList(typeof(EyouSoft.Model.EnumType.ConStructure.ContractStatus)), status.ToString(), true);
     //获取分页参数并强转
     pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"));
     //领用人
     string sellerId   = Utils.GetQueryStringValue(this.HrSelect1.HrSelectIDClient);
     string sellerName = Utils.GetQueryStringValue(this.HrSelect1.HrSelectNameClient);
     this.HrSelect1.HrSelectID   = sellerId;
     this.HrSelect1.HrSelectName = sellerName;
     //合同号
     string conCode = Utils.GetQueryStringValue("txt_ConCode");
     //领用时间
     DateTime?sDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txt_SDate"));
     DateTime?eDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txt_EDate"));
     EyouSoft.Model.ConStructure.MContractNumSearch searchModel = null;
     if (!string.IsNullOrEmpty(conCode) || !string.IsNullOrEmpty(sellerId) || !string.IsNullOrEmpty(sellerName) || status > -1 || sDate != null || eDate != null)
     {
         searchModel = new EyouSoft.Model.ConStructure.MContractNumSearch();
         searchModel.ContractCode = conCode;
         searchModel.UseId        = sellerId;
         if (string.IsNullOrEmpty(sellerId) && !string.IsNullOrEmpty(sellerName))
         {
             searchModel.UseName = sellerName;
         }
         searchModel.TimeStart = sDate;
         searchModel.TimeEnd   = eDate;
         if (status > -1)
         {
             searchModel.ContractStatus = (EyouSoft.Model.EnumType.ConStructure.ContractStatus)status;
         }
     }
     #endregion
     //获取列表
     IList <EyouSoft.Model.ConStructure.MContractNumList> list = new EyouSoft.BLL.ConStructure.BContractNum().GetContractNumList(SiteUserInfo.CompanyId, (int)HeTongLeiXing, searchModel, this.pageSize, this.pageIndex, ref this.recordCount);
     if (list != null && list.Count > 0)
     {
         rptList.DataSource = list;
         rptList.DataBind();
     }
     else
     {
         this.rptList.Controls.Add(new Label()
         {
             Text = "<tr><td colspan='11' align='center'>对不起,没有相关数据!</td></tr>"
         });
     }
     //绑定分页
     BindPage();
     //释放
     list = null;
 }
Exemplo n.º 7
0
        /// <summary>
        /// 保存
        /// </summary>
        protected void PageSave(string[] ids, string[] sts)
        {
            #region 表单取值
            string msg    = "";
            bool   result = false;
            Response.Clear();
            #endregion

            #region 表单验证
            if (ids.Length < 1 || ids.Length != sts.Length)
            {
                msg += "-操作有误!";
            }
            if (!string.IsNullOrEmpty(msg))
            {
                result = false;
                Response.Write("{\"result\":\"" + result + "\",\"msg\":\"" + msg + "\"}");
                Response.End();
                return;
            }
            #endregion

            #region 提交回应
            EyouSoft.BLL.ConStructure.BContractNum bll = new EyouSoft.BLL.ConStructure.BContractNum();
            int i = bll.ChangeContractStatus(CreateListModel(ids, sts));
            if (i == 0)
            {
                result = false;
                msg    = "操作失败!";
            }
            if (i == 1)
            {
                result = true;
                msg    = "操作成功!";
            }
            Response.Clear();
            Response.Write("{\"result\":\"" + result + "\",\"msg\":\"" + msg + "\"}");
            Response.End();
            #endregion
        }
Exemplo n.º 8
0
        /// <summary>
        /// 删除合同
        /// </summary>
        void DeleteHeTong()
        {
            if (!Privs_Delete)
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "你没有操作权限"));
            }

            var items = Utils.GetFormValues("txtHeTongId[]");

            if (items == null || items.Length == 0)
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "删除失败:没有要删除的合同信息。"));
            }

            var bll = new EyouSoft.BLL.ConStructure.BContractNum();

            foreach (var item in items)
            {
                bll.Delete(SiteUserInfo.CompanyId, item);
            }

            RCWE(UtilsCommons.AjaxReturnJson("1", "删除成功!"));
        }
Exemplo n.º 9
0
        /// <summary>
        /// shezhi status
        /// </summary>
        void SheZhiStatus()
        {
            string txtHeTongId = Utils.GetFormValue("txtHeTongId");
            string txtFS       = Utils.GetFormValue("txtFS");

            if (string.IsNullOrEmpty(txtHeTongId) || string.IsNullOrEmpty(txtFS))
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:异常请求"));
            }

            EyouSoft.Model.EnumType.ConStructure.ContractStatus?status = null;

            if (txtFS == "quxiaoguanlian")
            {
                status = EyouSoft.Model.EnumType.ConStructure.ContractStatus.领用;
            }
            if (txtFS == "xiaohao")
            {
                status = EyouSoft.Model.EnumType.ConStructure.ContractStatus.销号;
            }
            if (txtFS == "zuofei")
            {
                status = EyouSoft.Model.EnumType.ConStructure.ContractStatus.作废;
            }
            if (txtFS == "quxiaoxiaohao")
            {
                status = EyouSoft.Model.EnumType.ConStructure.ContractStatus.使用;
            }
            if (txtFS == "quxiaozuofei")
            {
                status = EyouSoft.Model.EnumType.ConStructure.ContractStatus.使用;
            }

            if (!status.HasValue)
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:异常请求"));
            }

            bool privs = false;

            switch (status.Value)
            {
            case EyouSoft.Model.EnumType.ConStructure.ContractStatus.领用:
                privs = true;
                break;

            case EyouSoft.Model.EnumType.ConStructure.ContractStatus.使用:
                privs = true;
                break;

            case EyouSoft.Model.EnumType.ConStructure.ContractStatus.未领用:
                privs = false;
                break;

            case EyouSoft.Model.EnumType.ConStructure.ContractStatus.销号:
                privs = CheckGrant(EyouSoft.Model.EnumType.PrivsStructure.Privs.合同管理_合同管理_销号);;
                break;

            case EyouSoft.Model.EnumType.ConStructure.ContractStatus.作废:
                privs = CheckGrant(EyouSoft.Model.EnumType.PrivsStructure.Privs.合同管理_合同管理_作废);;
                break;
            }

            if (!privs)
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:没有操作权限"));
            }

            int bllRetCode = new EyouSoft.BLL.ConStructure.BContractNum().SheZhiHeTongStatus(CurrentUserCompanyID, txtHeTongId, status.Value);

            if (bllRetCode == 1)
            {
                RCWE(UtilsCommons.AjaxReturnJson("1", "操作成功"));
            }
            else if (bllRetCode == -98)
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:未关联订单的合同不允许销号"));
            }
            else
            {
                RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败"));
            }
        }