Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            string redirectUrl = string.Format("{0}WareHouse/CanPledgeApplyList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 48, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

                this.navigation1.Routes.Add("质押", string.Format("{0}WareHouse/PledgeList.aspx", NFMT.Common.DefaultValue.NftmSiteName));
                this.navigation1.Routes.Add("可质押申请列表", redirectUrl);
                this.navigation1.Routes.Add("质押新增", string.Empty);

                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out pledgeApplyId) || pledgeApplyId <= 0)
                    Response.Redirect(redirectUrl);

                this.hidid.Value = pledgeApplyId.ToString();

                NFMT.WareHouse.BLL.PledgeApplyBLL pledgeApplyBLL = new NFMT.WareHouse.BLL.PledgeApplyBLL();
                result = pledgeApplyBLL.Get(user, pledgeApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                pledgeApply = result.ReturnValue as NFMT.WareHouse.Model.PledgeApply;

                result = pledgeApplyBLL.GetPledgeStockId(user, pledgeApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                this.hidsids.Value = result.ReturnValue.ToString();

            }
        }
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty, whereStr = string.Empty;

            int applyDept = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["a"]))
            {
                if (!int.TryParse(context.Request.QueryString["a"], out applyDept))
                    applyDept = 0;
            }

            DateTime fromDate = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request.QueryString["f"]))
            {
                if (!DateTime.TryParse(context.Request.QueryString["f"], out fromDate))
                    fromDate = NFMT.Common.DefaultValue.DefaultTime;
            }

            DateTime toDate = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request.QueryString["t"]))
            {
                if (!DateTime.TryParse(context.Request.QueryString["t"], out toDate))
                    toDate = NFMT.Common.DefaultValue.DefaultTime;
            }

            if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"]))
                int.TryParse(context.Request.QueryString["pagenum"], out pageIndex);
            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"]))
                orderStr = string.Format("{0} {1}", context.Request.QueryString["sortdatafield"].Trim(), context.Request.QueryString["sortorder"].Trim());

            NFMT.WareHouse.BLL.PledgeApplyBLL bll = new NFMT.WareHouse.BLL.PledgeApplyBLL();
            NFMT.Common.SelectModel select = bll.GetCanPledgeApplySelectModel(pageIndex, pageSize, orderStr, applyDept, fromDate, toDate);
            NFMT.Common.ResultModel result = bll.Load(user, select);

            context.Response.ContentType = "application/json; charset=utf-8";
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
            System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>();

            dic.Add("count", result.AffectCount);
            dic.Add("data", dt);

            string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic);

            context.Response.Write(postData);
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectURL = string.Format("{0}WareHouse/PledgeApplyList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 47, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                this.navigation1.Routes.Add("质押申请", redirectURL);
                this.navigation1.Routes.Add("质押申请修改", string.Empty);

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

                int pledgeApplyId = 0;
                if (!int.TryParse(Request.QueryString["id"], out pledgeApplyId))
                    Response.Redirect(redirectURL);

                this.hidpledgeApplyId.Value = pledgeApplyId.ToString();

                NFMT.WareHouse.BLL.PledgeApplyDetailBLL pledgeApplyDetailBLL = new NFMT.WareHouse.BLL.PledgeApplyDetailBLL();
                NFMT.Common.ResultModel result = pledgeApplyDetailBLL.GetStockIds(user, pledgeApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                this.hidsids.Value = result.ReturnValue.ToString();

                NFMT.WareHouse.BLL.PledgeApplyBLL pledgeApplyBLL = new NFMT.WareHouse.BLL.PledgeApplyBLL();
                result = pledgeApplyBLL.GetPledgeApplyDetails(user, pledgeApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                this.hidDetails.Value = Newtonsoft.Json.JsonConvert.SerializeObject(result.ReturnValue);

                result = pledgeApplyBLL.Get(user, pledgeApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                pledgeApply = result.ReturnValue as NFMT.WareHouse.Model.PledgeApply;
                if (pledgeApply == null)
                    Response.Redirect(redirectURL);

                NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = applyBLL.Get(user, pledgeApply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                apply = result.ReturnValue as NFMT.Operate.Model.Apply;

                //this.hidDeptId.Value = apply.ApplyDept.ToString();
                this.txbMemo.Value = apply.ApplyDesc;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            string applyStr = context.Request.Form["apply"];
            if (string.IsNullOrEmpty(applyStr))
            {
                context.Response.Write("申请信息不能为空");
                context.Response.End();
            }

            string pledgeApplyStr = context.Request.Form["pledgeApply"];
            if (string.IsNullOrEmpty(pledgeApplyStr))
            {
                context.Response.Write("质押申请信息不能为空");
                context.Response.End();
            }

            string detailsStr = context.Request.Form["rows"];
            if (string.IsNullOrEmpty(detailsStr))
            {
                context.Response.Write("明细内容不能为空");
                context.Response.End();
            }

            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                NFMT.Operate.Model.Apply apply = serializer.Deserialize<NFMT.Operate.Model.Apply>(applyStr);
                NFMT.WareHouse.Model.PledgeApply pledgeApply = serializer.Deserialize<NFMT.WareHouse.Model.PledgeApply>(pledgeApplyStr);
                List<NFMT.WareHouse.Model.PledgeApplyDetail> details = serializer.Deserialize<List<NFMT.WareHouse.Model.PledgeApplyDetail>>(detailsStr);
                if (apply == null || pledgeApply == null || details == null || !details.Any())
                {
                    context.Response.Write("数据错误");
                    context.Response.End();
                }
                apply.ApplyType = NFMT.Operate.ApplyType.PledgeApply;
                apply.EmpId = user.EmpId;
                apply.ApplyTime = DateTime.Now;

                NFMT.WareHouse.BLL.PledgeApplyBLL pledgeApplyBLL = new NFMT.WareHouse.BLL.PledgeApplyBLL();
                result = pledgeApplyBLL.PledgeApplyUpdateHandle(user, apply, pledgeApply, details);
                if (result.ResultStatus == 0)
                    result.Message = "质押申请修改成功";
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = string.Format("{0}WareHouse/PledgeList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 48, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                this.navigation1.Routes.Add("质押", redirectUrl);
                this.navigation1.Routes.Add("质押修改", string.Empty);

                int pledgeId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out pledgeId) || pledgeId <= 0)
                    Response.Redirect(redirectUrl);

                this.hidid.Value = pledgeId.ToString();

                NFMT.WareHouse.BLL.PledgeBLL pledgeBLL = new NFMT.WareHouse.BLL.PledgeBLL();
                NFMT.Common.ResultModel result = pledgeBLL.Get(user, pledgeId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                pledge = result.ReturnValue as NFMT.WareHouse.Model.Pledge;
                if (pledge == null)
                    Response.Redirect(redirectUrl);

                int pledgeApplyId = pledge.PledgeApplyId;
                this.hidbankId.Value  = pledge.PledgeBank.ToString();
                //this.hiddeptId.Value = pledge.PledgeDept.ToString();
                this.txbMemo.Value = pledge.Memo;

                NFMT.WareHouse.BLL.PledgeApplyBLL pledgeApplyBLL = new NFMT.WareHouse.BLL.PledgeApplyBLL();
                result = pledgeApplyBLL.GetPledgeStockId(user, pledgeApplyId);
                //if (result.ResultStatus != 0)
                //    Response.Redirect(redirectUrl);

                this.hidsidsDown.Value = result.ReturnValue != null ? result.ReturnValue.ToString() : "";

                NFMT.WareHouse.BLL.PledgeDetialBLL pledgeDetialBLL = new NFMT.WareHouse.BLL.PledgeDetialBLL();
                result = pledgeDetialBLL.GetStockIds(user, pledgeId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                this.hidsidsUp.Value = result.ReturnValue.ToString();

                //attach
                this.attach1.BusinessIdValue = this.pledge.PledgeId;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            context.Response.ContentType = "text/plain";

            int pledgeApplyId = 0;
            int operateId = 0;

            if (!int.TryParse(context.Request.Form["id"], out pledgeApplyId) || pledgeApplyId <= 0)
            {
                result.Message = "出库申请序号错误";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

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

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId;

            NFMT.WareHouse.BLL.PledgeApplyBLL bll = new NFMT.WareHouse.BLL.PledgeApplyBLL();

            switch (operateEnum)
            {
                case NFMT.Common.OperateEnum.撤返:
                    result = bll.Goback(user, pledgeApplyId);
                    break;
                case NFMT.Common.OperateEnum.作废:
                    result = bll.Invalid(user, pledgeApplyId);
                    break;
                case NFMT.Common.OperateEnum.确认完成:
                    result = bll.Confirm(user, pledgeApplyId);
                    break;
                case NFMT.Common.OperateEnum.确认完成撤销:
                    result = bll.ConfirmCancel(user, pledgeApplyId);
                    break;
            }

            if (result.ResultStatus == 0)
                result.Message = string.Format("{0}成功", operateEnum.ToString());

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

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            int pledgeApplyId = 0;
            if (!string.IsNullOrEmpty(context.Request.Form["id"]))
            {
                if (!int.TryParse(context.Request.Form["id"], out pledgeApplyId))
                {
                    context.Response.Write("参数错误");
                    context.Response.End();
                }
            }

            NFMT.WareHouse.BLL.PledgeApplyBLL bll = new NFMT.WareHouse.BLL.PledgeApplyBLL();
            result = bll.Complete(user, pledgeApplyId);
            context.Response.Write(result.Message);
        }
Beispiel #8
0
        public int id = 0; //PledgeApplyId

        #endregion Fields

        #region Methods

        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            string redirectURL = string.Format("{0}WareHouse/PledgeApplyList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 47, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.确认完成, NFMT.Common.OperateEnum.确认完成撤销 });

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                this.navigation1.Routes.Add("质押申请", redirectURL);
                this.navigation1.Routes.Add("质押申请明细", string.Empty);

                NFMT.WareHouse.BLL.PledgeApplyBLL pledgeApplyBLL = new NFMT.WareHouse.BLL.PledgeApplyBLL();

                if (!string.IsNullOrEmpty(Request.QueryString["aid"]) && int.TryParse(Request.QueryString["aid"], out applyId) && applyId > 0)
                {
                    result = pledgeApplyBLL.GetPledgeByApplyId(user, applyId);
                    if (result.ResultStatus != 0)
                        Response.Redirect(redirectURL);

                    NFMT.WareHouse.Model.PledgeApply pledgeApply1 = result.ReturnValue as NFMT.WareHouse.Model.PledgeApply;
                    if (pledgeApply1 == null)
                        Response.Redirect(redirectURL);

                    id = pledgeApply1.PledgeApplyId;
                }
                else
                {
                    if (!string.IsNullOrEmpty(Request.QueryString["id"]))
                        int.TryParse(Request.QueryString["id"], out id);
                }

                if (id <= 0)
                    Response.Redirect(redirectURL);

                this.hidid.Value = id.ToString();

                result = pledgeApplyBLL.Get(user, id);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                NFMT.WareHouse.Model.PledgeApply pledgeApply = result.ReturnValue as NFMT.WareHouse.Model.PledgeApply;
                if (pledgeApply == null)
                    Response.Redirect(redirectURL);

                applyId = pledgeApply.ApplyId;

                result = pledgeApplyBLL.GetPledgeApplyDetails(user, pledgeApply.PledgeApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                this.hidDetails.Value = Newtonsoft.Json.JsonConvert.SerializeObject(result.ReturnValue);

                NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = applyBLL.Get(user, pledgeApply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                apply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if (apply == null)
                    Response.Redirect(redirectURL);

                NFMT.User.Model.Department dept = NFMT.User.UserProvider.Departments.SingleOrDefault(a => a.DeptId == apply.ApplyDept);
                if (dept == null)
                    Response.Redirect(redirectURL);

                NFMT.User.Model.Corporation corp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == apply.ApplyCorp);
                if (corp == null)
                    Response.Redirect(redirectURL);

                NFMT.Data.Model.Bank bank = NFMT.Data.BasicDataProvider.Banks.SingleOrDefault(a => a.BankId == pledgeApply.PledgeBank);
                if (bank == null)
                    Response.Redirect(redirectURL);

                this.txbApplyDept.InnerText = dept.DeptName;
                this.txbApplyCorp.InnerText = corp.CorpName;
                this.txbMemo.InnerText = apply.ApplyDesc;
                this.txbPledgeBank.InnerText = bank.BankName;

                string json = serializer.Serialize(apply);
                this.hidmodel.Value = json;
            }
        }