Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int masterId = 0;

                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    Response.Redirect("MasterClauseList.aspx");

                if (!int.TryParse(Request.QueryString["id"], out masterId))
                    Response.Redirect("MasterClauseList.aspx");

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

                NFMT.Data.BLL.ContractMasterBLL masterBLL = new NFMT.Data.BLL.ContractMasterBLL();
                NFMT.Common.ResultModel result = masterBLL.Get(user, masterId);
                if(result.ResultStatus!=0)
                    Response.Redirect("MasterClauseList.aspx");

                NFMT.Data.Model.ContractMaster master = result.ReturnValue as NFMT.Data.Model.ContractMaster;

                if (master == null || master.MasterId <= 0)
                    Response.Redirect("MasterClauseList.aspx");

                this.spnMasterEname.InnerHtml = master.MasterEname;
                this.spnMasterName.InnerHtml = master.MasterName;
                this.spnMasterStatus.InnerHtml = master.MasterStatusName;
                this.hidMasterId.Value = master.MasterId.ToString();

                this.navigation1.Routes.Add("合约模板列表", "MasterClauseAllot.aspx");
                this.navigation1.Routes.Add("条款分配", string.Empty);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            string masterName = context.Request.Form["mn"];
            string masterEname = context.Request.Form["men"];

            if (string.IsNullOrEmpty(masterName))
            {
                result.Message = "合约模板名称不能为空";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

            if (string.IsNullOrEmpty(masterEname))
            {
                result.Message = "合约模板英文名称不能为空";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

            NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
            NFMT.Data.Model.ContractMaster master = new NFMT.Data.Model.ContractMaster();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            master.CreatorId = user.EmpId;
            master.MasterName = masterName;
            master.MasterEname = masterEname;
            master.MasterStatus = NFMT.Common.StatusEnum.已录入;

            result = bll.Insert(user, master);

            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int refId = 0;

                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    Response.Redirect("MasterClauseAllot.aspx");
                if(!int.TryParse(Request.QueryString["id"],out refId))
                    Response.Redirect("MasterClauseAllot.aspx");

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Data.BLL.ClauseContractBLL refBLL = new NFMT.Data.BLL.ClauseContractBLL();

                NFMT.Common.ResultModel result = refBLL.Get(user, refId);
                if(result.ResultStatus!=0)
                    Response.Redirect("MasterClauseAllot.aspx");
                NFMT.Data.Model.ClauseContract masterClause = result.ReturnValue as NFMT.Data.Model.ClauseContract;
                if(masterClause==null || masterClause.RefId<=0)
                    Response.Redirect("MasterClauseAllot.aspx");

                NFMT.Data.BLL.ContractMasterBLL masterBLL = new NFMT.Data.BLL.ContractMasterBLL();
                result = masterBLL.Get(user,masterClause.MasterId);
                if(result.ResultStatus!=0)
                    Response.Redirect("MasterClauseAllot.aspx");
                NFMT.Data.Model.ContractMaster master = result.ReturnValue as NFMT.Data.Model.ContractMaster;
                if(master==null || master.MasterId<=0)
                    Response.Redirect("MasterClauseAllot.aspx");

                NFMT.Data.BLL.ContractClauseBLL clauseBLL = new NFMT.Data.BLL.ContractClauseBLL();
                result = clauseBLL.Get(user, masterClause.ClauseId);
                if(result.ResultStatus!=0)
                    Response.Redirect("MasterClauseAllot.aspx");
                NFMT.Data.Model.ContractClause clause = result.ReturnValue as NFMT.Data.Model.ContractClause;
                if(clause==null || clause.ClauseId<=0)
                    Response.Redirect("MasterClauseAllot.aspx");

                this.spnClauseEtext.InnerHtml = clause.ClauseEnText;
                this.spnClauseText.InnerHtml = clause.ClauseText;
                this.spnMasterEname.InnerHtml = master.MasterEname;
                this.spnMasterName.InnerHtml = master.MasterName;

                this.chkIsChose.Checked = masterClause.IsChose;
                this.txbSort.Value = masterClause.Sort.ToString();

                this.hidRefId.Value = masterClause.RefId.ToString();

                int masterId = 0;
                int.TryParse(Request.QueryString["mid"],out masterId);

                this.navigation1.Routes.Add("合约模板列表", "MasterClauseAllot.aspx");
                this.navigation1.Routes.Add("模板条款分配", string.Format("MasterClauseCreate.aspx?id={0}",masterId));
                this.navigation1.Routes.Add("分配修改",string.Empty);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string masterName = context.Request.Form["mn"];
            string masterEname = context.Request.Form["men"];
            int masterStatus = 0;
            int masterId = 0;

            string resultStr = "添加失败";

            if (string.IsNullOrEmpty(masterName))
            {
                resultStr = "合约模板名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(masterEname))
            {
                resultStr = "合约模板英文名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["ms"], out masterStatus) || masterStatus <= 0)
            {
                resultStr = "必须选择数据状态";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["mid"], out masterId) || masterId <= 0)
            {
                resultStr = "模板序号错误";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
            NFMT.Data.Model.ContractMaster master = new NFMT.Data.Model.ContractMaster();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            master.LastModifyId = user.EmpId;
            master.MasterName = masterName;
            master.MasterEname = masterEname;
            master.MasterId = masterId;
            master.MasterStatus = (NFMT.Common.StatusEnum)masterStatus;

            NFMT.Common.ResultModel result = bll.Update(user, master);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 77, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.冻结, NFMT.Common.OperateEnum.解除冻结 });

                int masterId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    Response.Redirect("ContractMasterList.aspx");

                if (int.TryParse(Request.QueryString["id"], out masterId))
                {
                    if (masterId == 0)
                        Response.Redirect("ContractMasterList.aspx");

                    NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                    NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
                    NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
                    result = bll.Get(user, masterId);
                    if (result.ResultStatus != 0)
                        Response.Redirect("ContractMasterList.aspx");
                    NFMT.Data.Model.ContractMaster master = result.ReturnValue as NFMT.Data.Model.ContractMaster;

                    if (master == null || master.MasterId <= 0)
                        Response.Redirect("ContractMasterList.aspx");

                    this.spnMasterEname.InnerHtml = master.MasterEname;
                    this.spnMasterName.InnerHtml = master.MasterName;
                    this.spnMasterStatus.InnerHtml = master.MasterStatusName;
                    this.hidMasterId.Value = master.MasterId.ToString();

                    this.navigation1.Routes.Add("合约模板列表", "ContractMasterList.aspx");
                    this.navigation1.Routes.Add("合约模板明细", string.Empty);
                }
                else
                    Response.Redirect("ContractMasterList.aspx");
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int masterId = 0;
            int operateId = 0;

            if (!int.TryParse(context.Request.Form["mi"], out masterId) || masterId <= 0)
            {
                context.Response.Write( "模板序号错误");
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["oi"], out operateId) || operateId <= 0)
            {
                context.Response.Write("操作错误");
                context.Response.End();
            }

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
            NFMT.Data.Model.ContractMaster master = new NFMT.Data.Model.ContractMaster();
            master.LastModifyId = user.EmpId;
            master.MasterId = masterId;

            NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            switch (operateEnum)
            {
                case NFMT.Common.OperateEnum.冻结:
                    result = bll.Freeze(user, master);
                    break;
                case NFMT.Common.OperateEnum.解除冻结:
                    result = bll.UnFreeze(user, master);
                    break;
            }

            context.Response.Write( result.Message);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            int status = -1;
            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;
            string sortDataField = string.Empty;
            string sortOrder = string.Empty;

            NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
            NFMT.Common.ResultModel result = bll.Load<NFMT.Data.Model.ContractMaster>(Utility.UserUtility.CurrentUser);
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            List<NFMT.Data.Model.ContractMaster> masters = result.ReturnValue as List<NFMT.Data.Model.ContractMaster>;
            //List<NFMT.Data.Model.ContractMaster> masters = NFMT.Data.BasicDataProvider.ContractMasters;

            string masterName = context.Request["n"];//模糊搜索
            if (!string.IsNullOrEmpty(masterName))
                masters = masters.Where(temp => temp.MasterName.Contains(masterName)).ToList();

            if (!string.IsNullOrEmpty(context.Request["s"]))
            {
                if (int.TryParse(context.Request["s"], out status) && status > 0)
                    masters = masters.Where(temp => (int)temp.MasterStatus == status).ToList();
            }

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"]))
                int.TryParse(context.Request.QueryString["pagesize"], out pageSize);

            if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"]))
            {
                sortDataField = context.Request.QueryString["sortdatafield"].Trim();
                sortOrder = context.Request.QueryString["sortorder"].Trim();

                if (sortDataField == "MasterStatusName")
                {
                    if (sortOrder.ToLower() == "asc")
                        masters = (from m in masters orderby m.MasterStatus ascending select m).ToList();
                    else if (sortOrder.ToLower() == "desc")
                        masters = (from m in masters orderby m.MasterStatus descending select m).ToList();
                }
                else if (sortDataField == "MasterName")
                {
                    if (sortOrder.ToLower() == "asc")
                        masters = (from m in masters orderby m.MasterName ascending select m).ToList();
                    else if (sortOrder.ToLower() == "desc")
                        masters = (from m in masters orderby m.MasterName descending select m).ToList();
                }
                else if (sortDataField == "MasterEname")
                {
                    if (sortOrder.ToLower() == "asc")
                        masters = (from m in masters orderby m.MasterEname ascending select m).ToList();
                    else if (sortOrder.ToLower() == "desc")
                        masters = (from m in masters orderby m.MasterEname descending select m).ToList();
                }
            }

            masters = (from m in masters orderby m.MasterId descending select m).ToList();

            int count = masters.Count;

            context.Response.ContentType = "application/json; charset=utf-8";
            int pageStart = pageIndex * pageSize;
            masters = masters.Skip(pageStart).Take(pageSize).ToList();

            Dictionary<string, object> dic = new Dictionary<string, object>();
            dic.Add("count", count);
            dic.Add("data", masters);

            string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dic);
            context.Response.Write(jsonStr);
        }