Пример #1
0
        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 pledgeId = 0;
            if (!string.IsNullOrEmpty(context.Request.Form["id"]))
            {
                if (!int.TryParse(context.Request.Form["id"], out pledgeId))
                {
                    result.Message = "参数错误";
                    context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                    context.Response.End();
                }
            }

            NFMT.WareHouse.BLL.PledgeBLL bll = new NFMT.WareHouse.BLL.PledgeBLL();
            result = bll.Complete(user, pledgeId);
            if (result.ResultStatus == 0)
                result.Message = "成功完成";

            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            if (string.IsNullOrEmpty(context.Request.Form["source"]))
            {
                result.Message = "数据源为空";
                result.ResultStatus = -1;
                context.Response.Write(serializer.Serialize(result));
                context.Response.End();
            }

            try
            {
                string jsonData = context.Request.Form["source"];
                var obj = serializer.Deserialize<NFMT.WorkFlow.Model.DataSource>(jsonData);

                NFMT.WareHouse.BLL.PledgeBLL bll = new NFMT.WareHouse.BLL.PledgeBLL();
                result = bll.PledgeHandle(user, obj, Convert.ToBoolean(context.Request.Form["ispass"]));
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
                result.ResultStatus = -1;
            }

            context.Response.Write(serializer.Serialize(result));
            context.Response.End();
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            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.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.执行完成, NFMT.Common.OperateEnum.执行完成撤销 });

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

                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);

                NFMT.Data.Model.Bank bank = NFMT.Data.BasicDataProvider.Banks.SingleOrDefault(a => a.BankId == pledge.PledgeBank);
                if (bank == null)
                    Response.Redirect(redirectUrl);
                this.ddlPledgeBank.InnerText = bank.BankName;

                NFMT.User.Model.Employee emp = NFMT.User.UserProvider.Employees.SingleOrDefault(a => a.EmpId == pledge.Pledger);
                if (emp == null)
                    Response.Redirect(redirectUrl);
                this.ddlPledger.InnerText = emp.Name;

                this.txbMoveMemo.InnerText = pledge.Memo;

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

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

                string json = serializer.Serialize(pledge);
                this.hidModel.Value = json;

                //attach
                this.attach1.BusinessIdValue = this.pledgeId;
            }
        }
Пример #4
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            context.Response.ContentType = "text/plain";

            int pledgeId = 0;
            int operateId = 0;

            if (!int.TryParse(context.Request.Form["id"], out pledgeId) || pledgeId <= 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.PledgeBLL bll = new NFMT.WareHouse.BLL.PledgeBLL();

            switch (operateEnum)
            {
                case NFMT.Common.OperateEnum.撤返:
                    result = bll.GoBack(user, pledgeId);
                    break;
                case NFMT.Common.OperateEnum.作废:
                    result = bll.Invalid(user, pledgeId);
                    break;
                case NFMT.Common.OperateEnum.执行完成:
                    result = bll.Complete(user, pledgeId);
                    break;
                case NFMT.Common.OperateEnum.执行完成撤销:
                    result = bll.CompleteCancel(user, pledgeId);
                    break;
                case NFMT.Common.OperateEnum.关闭:
                    result = bll.Close(user, pledgeId);
                    break;
            }

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

            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }
Пример #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;
            }
        }
Пример #6
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

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

            string sids = context.Request.QueryString["sids"];

            int pledgeApplyId = 0;
            if (string.IsNullOrEmpty(context.Request.QueryString["pid"]) || !int.TryParse(context.Request.QueryString["aid"], out pledgeApplyId) || pledgeApplyId <= 0)
                pledgeApplyId = 0;

            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.PledgeBLL bll = new NFMT.WareHouse.BLL.PledgeBLL();
            NFMT.Common.SelectModel select = bll.GetPledgeSelect(pageIndex, pageSize, orderStr, sids, pledgeApplyId);
            NFMT.Common.IAuthority auth = new NFMT.Authority.StockAuth();
            //auth.AuthColumnNames.Add("sto.StockId");

            NFMT.Common.ResultModel result = bll.Load(user, select,auth);

            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);
        }
Пример #7
0
        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 resultStr = "作废失败";

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

            NFMT.WareHouse.BLL.PledgeBLL bll = new NFMT.WareHouse.BLL.PledgeBLL();
            result = bll.Invalid(user, pledgeId);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
Пример #8
0
        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 pledgeStr = context.Request.Form["pledge"];
            if (string.IsNullOrEmpty(pledgeStr))
            {
                context.Response.Write("质押信息不能为空");
                context.Response.End();
            }

            string rowsStr = context.Request.Form["rows"];
            if (string.IsNullOrEmpty(rowsStr))
            {
                context.Response.Write("质押明细信息不能为空");
                context.Response.End();
            }

            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                NFMT.WareHouse.Model.Pledge pledge = serializer.Deserialize<NFMT.WareHouse.Model.Pledge>(pledgeStr);
                List<NFMT.WareHouse.Model.PledgeApplyDetail> details = serializer.Deserialize<List<NFMT.WareHouse.Model.PledgeApplyDetail>>(rowsStr);
                if (pledge == null || details == null || !details.Any())
                {
                    context.Response.Write("数据错误");
                    context.Response.End();
                }

                List<NFMT.WareHouse.Model.PledgeDetial> pledgeDetials = new List<NFMT.WareHouse.Model.PledgeDetial>();
                foreach (NFMT.WareHouse.Model.PledgeApplyDetail detail in details)
                {
                    pledgeDetials.Add(new NFMT.WareHouse.Model.PledgeDetial()
                    {
                        PledgeApplyDetailId = detail.DetailId,
                        StockId = detail.StockId,
                        GrossAmount = detail.ApplyQty,
                        Unit = detail.UintId,
                        PledgePrice = detail.PledgePrice,
                        CurrencyId = detail.CurrencyId
                    });
                }

                pledge.Pledger = user.EmpId;
                pledge.PledgeTime = DateTime.Now;

                NFMT.WareHouse.BLL.PledgeBLL bll = new NFMT.WareHouse.BLL.PledgeBLL();
                result = bll.PledgeUpdateHandle(user, pledge, pledgeDetials);

                if (result.ResultStatus == 0)
                    result.Message = "质押修改成功";
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }
Пример #9
0
        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 pledge = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["p"]))
            {
                if (!int.TryParse(context.Request.QueryString["p"], out pledge))
                    pledge = 0;
            }

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

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

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

            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.PledgeBLL pledgeBLL = new NFMT.WareHouse.BLL.PledgeBLL();
            NFMT.Common.SelectModel select = pledgeBLL.GetSelectModel(pageIndex, pageSize, orderStr, pledge, status, bank, dept);
            //NFMT.Authority.CorpAuth auth = new NFMT.Authority.CorpAuth();
            NFMT.Common.ResultModel result = pledgeBLL.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);
        }