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 pledgeApplyId = 0;
            if (!string.IsNullOrEmpty(context.Request.QueryString["pid"]))
            {
                if (!int.TryParse(context.Request.QueryString["pid"], out pledgeApplyId))
                    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());

            FinanceService.FinService service = new FinanceService.FinService();
            string result = service.GetFinancingPledgeApplyStockDetailForHandList(pageIndex, 500, orderStr, pledgeApplyId);
            context.Response.Write(result);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string resultStr = string.Empty;

            string repoApplyStr = context.Request.Form["repoApply"];
            if (string.IsNullOrEmpty(repoApplyStr))
            {
                context.Response.Write("赎回申请单信息不能为空");
                context.Response.End();
            }
            string rowsStr = context.Request.Form["rows"];
            if (string.IsNullOrEmpty(rowsStr))
            {
                context.Response.Write("明细信息不能为空");
                context.Response.End();
            }

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

            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                NFMT.Finance.Model.RepoApply repoApply = serializer.Deserialize<NFMT.Finance.Model.RepoApply>(repoApplyStr);
                List<NFMT.Finance.Model.RepoApplyDetail> details = serializer.Deserialize<List<NFMT.Finance.Model.RepoApplyDetail>>(rowsStr);
                if (repoApply == null || details == null || !details.Any())
                {
                    context.Response.Write("信息错误");
                    context.Response.End();
                }

                decimal sumNetAmount = 0;
                int sumHands = 0;
                foreach (NFMT.Finance.Model.RepoApplyDetail detail in details)
                {
                    sumNetAmount += detail.NetAmount;
                    sumHands += detail.Hands;
                }

                repoApply.SumNetAmount = sumNetAmount;
                repoApply.SumHands = sumHands;

                string userJson = serializer.Serialize(user);
                string repoApplyJson = serializer.Serialize(repoApply);

                FinanceService.FinService service = new FinanceService.FinService();
                resultStr = service.FinRepoApplyUpdate(userJson, repoApplyJson, rowsStr);
            }
            catch (Exception e)
            {
                result.ResultStatus = -1;
                result.Message = e.Message;
            }

            context.Response.Write(resultStr);
            context.Response.End();
        }
        public void ProcessRequest(HttpContext context)
        {
            int status = -1, assetId = -1, bankId = -1;
            int pageIndex = 1, pageSize = 10;
            string orderStr = string.Empty;

            string pledgeApplyNo = context.Request["paNo"];
            string refNo = context.Request["refNo"];

            DateTime beginDate = NFMT.Common.DefaultValue.DefaultTime;
            DateTime endDate = NFMT.Common.DefaultValue.DefaultTime;

            if (!string.IsNullOrEmpty(context.Request["fromDate"]))
            {
                if (!DateTime.TryParse(context.Request["fromDate"], out beginDate))
                    beginDate = NFMT.Common.DefaultValue.DefaultTime;
            }
            if (!string.IsNullOrEmpty(context.Request["toDate"]))
            {
                if (!DateTime.TryParse(context.Request["toDate"], out endDate))
                    endDate = NFMT.Common.DefaultValue.DefaultTime;
                else
                    endDate = endDate.AddDays(1);
            }

            if (!string.IsNullOrEmpty(context.Request["status"]))
                int.TryParse(context.Request["status"], out status);

            if (!string.IsNullOrEmpty(context.Request["assetId"]))
                int.TryParse(context.Request["assetId"], out assetId);

            if (!string.IsNullOrEmpty(context.Request["bankId"]))
                int.TryParse(context.Request["bankId"], out bankId);

            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"]))
            {
                string sortDataField = context.Request.QueryString["sortdatafield"].Trim();
                string sortOrder = context.Request.QueryString["sortorder"].Trim();
                orderStr = string.Format("{0} {1}", sortDataField, sortOrder);
            }

            FinanceService.FinService service = new FinanceService.FinService();
            string result = service.GetFinancingPledgeApplyListForRepoCreate(pageIndex, pageSize, orderStr, beginDate, endDate, bankId, assetId, status, pledgeApplyNo, refNo);
            context.Response.Write(result);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string resultStr = string.Empty;

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

            bool isSubmitAudit = false;
            if (string.IsNullOrEmpty(context.Request.Form["isAudit"]) || !bool.TryParse(context.Request.Form["isAudit"], out isSubmitAudit))
                isSubmitAudit = false;

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

            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                FinanceService.PledgeApply pledgeApply = serializer.Deserialize<FinanceService.PledgeApply>(pledgeApplyStr);
                List<FinanceService.PledgeApplyStockDetail> pledgeApplyStockDetails = serializer.Deserialize<List<FinanceService.PledgeApplyStockDetail>>(rowsStr);
                if (pledgeApply == null || pledgeApplyStockDetails == null || !pledgeApplyStockDetails.Any())
                {
                    context.Response.Write("信息错误");
                    context.Response.End();
                }

                string userJson = serializer.Serialize(user);
                FinanceService.UserModel serviceUser = serializer.Deserialize<FinanceService.UserModel>(userJson);

                FinanceService.FinService service = new FinanceService.FinService();
                resultStr = service.FinancingPledgeApplyCreate(serviceUser, pledgeApply, pledgeApplyStockDetails.ToArray(), isSubmitAudit);
            }
            catch (Exception e)
            {
                result.ResultStatus = -1;
                result.Message = e.Message;
            }

            context.Response.Write(resultStr);
            context.Response.End();
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

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

            string refNo = context.Request["text"];

            FinanceService.FinService service = new FinanceService.FinService();
            string json = service.GetFinStockInfo(refNo.ToLower());

            context.Response.Write(json);
            context.Response.End();
        }
        public void ProcessRequest(HttpContext context)
        {
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            context.Response.ContentType = "text/plain";
            int id = 0;
            int operateId = 0;

            if (!int.TryParse(context.Request.Form["id"], out id) || id <= 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.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId;
            string resultStr = string.Empty;

            string userJson = serializer.Serialize(user);

            NFMT.Finance.BLL.PledgeApplyBLL bll = new NFMT.Finance.BLL.PledgeApplyBLL();
            FinanceService.FinService service = new FinanceService.FinService();
            switch (operateEnum)
            {
                case NFMT.Common.OperateEnum.作废:
                    resultStr = service.FinancingPledgeApplyInvalid(userJson, id);
                    break;
                case NFMT.Common.OperateEnum.撤返:
                    resultStr = service.FinancingPledgeApplyGoBack(userJson, id);
                    break;
                case NFMT.Common.OperateEnum.执行完成:
                    resultStr = service.FinancingPledgeApplyIdComplete(userJson, id);
                    break;
                case NFMT.Common.OperateEnum.执行完成撤销:
                    resultStr = service.FinancingPledgeApplyIdCompleteCancel(userJson, id);
                    break;
                case NFMT.Common.OperateEnum.关闭:
                    resultStr = service.FinancingPledgeApplyClose(userJson, id);
                    break;
            }

            context.Response.Write(resultStr);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string resultStr = string.Empty;

            string rowsStr = context.Request.Form["rows"];
            if (string.IsNullOrEmpty(rowsStr))
            {
                context.Response.Write("期货头寸信息不能为空");
                context.Response.End();
            }

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

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

            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                List<NFMT.Finance.Model.PledgeApplyCashDetail> pledgeApplyCashDetails = serializer.Deserialize<List<NFMT.Finance.Model.PledgeApplyCashDetail>>(rowsStr);
                if (pledgeApplyCashDetails == null || !pledgeApplyCashDetails.Any())
                {
                    context.Response.Write("信息错误");
                    context.Response.End();
                }

                string userJson = serializer.Serialize(user);

                FinanceService.FinService service = new FinanceService.FinService();
                resultStr = service.FinancingPledgeApplyUpdateCash(userJson, rowsStr, pledgeApplyId);
            }
            catch (Exception e)
            {
                result.ResultStatus = -1;
                result.Message = e.Message;
            }

            context.Response.Write(resultStr);
            context.Response.End();
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string resultStr = string.Empty;

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

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

            try
            {
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                FinanceService.PledgeApply pledgeApply = serializer.Deserialize<FinanceService.PledgeApply>(pledgeApplyStr);
                List<FinanceService.PledgeApplyStockDetail> pledgeApplyStockDetails = serializer.Deserialize<List<FinanceService.PledgeApplyStockDetail>>(rowsStr);
                if (pledgeApply == null || pledgeApplyStockDetails == null || !pledgeApplyStockDetails.Any())
                {
                    context.Response.Write("信息错误");
                    context.Response.End();
                }

                string userJson = serializer.Serialize(user);

                FinanceService.FinService service = new FinanceService.FinService();
                resultStr = service.FinancingPledgeApplyUpdate(userJson, pledgeApplyStr, rowsStr);
            }
            catch (Exception e)
            {
                resultStr = e.Message;
            }

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

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            FinanceService.FinService service = new FinanceService.FinService();
            string json = service.GetStockInfoFromBusinessSystem();
            context.Response.Write(json);
            context.Response.End();
            //if (string.IsNullOrEmpty(json))
            //{
            //    context.Response.Write(string.Empty);
            //    context.Response.End();
            //}

            //System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            //List<MyStock> myStocks = new List<MyStock>();
            //try
            //{
            //    myStocks = serializer.Deserialize<List<MyStock>>(json);
            //}
            //catch
            //{

            //}

            //List<MyStockOut> myStockOuts = new List<MyStockOut>();
            //if (myStocks != null && myStocks.Any())
            //{
            //    myStocks.ForEach(a =>
            //    {
            //        myStockOuts.Add(new MyStockOut
            //        {
            //            RefNo = a.RefNo,
            //            StockIdAndNetAmount = string.Format("{0}{1}{2}", a.StockId, "||", a.NetAmount)
            //        });
            //    });

            //    context.Response.Write(serializer.Serialize(myStockOuts));
            //    context.Response.End();
            //}
            //context.Response.Write(string.Empty);
            //context.Response.End();
        }