protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!UserOperate.Contains(OperateEnum.修改))
                    btnSave.Style.Add("display", "none");

                string redirectUrl = "FinancingPledgeApplyList.aspx";
                navigation1.Routes.Add("质押申请单列表", redirectUrl);
                navigation1.Routes.Add("质押申请单修改", string.Empty);

                int pledgeApplyId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out pledgeApplyId) || pledgeApplyId <= 0)
                    this.WarmAlert("参数错误", redirectUrl);

                PledgeApplyBLL pledgeApplyBLL = new PledgeApplyBLL();
                ResultModel result = pledgeApplyBLL.Get(User, pledgeApplyId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurPledgeApply = result.ReturnValue as PledgeApply;
                if (CurPledgeApply == null || CurPledgeApply.PledgeApplyId <= 0)
                    this.WarmAlert("获取质押申请单错误", redirectUrl);

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string redirectUrl = "FinancingPledgeApplyList.aspx";

                int id = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out id))
                    this.WarmAlert("参数错误", redirectUrl);

                if (string.IsNullOrEmpty(Request.QueryString["taskNodeId"]) || !int.TryParse(Request.QueryString["taskNodeId"], out taskNodeId))
                    this.WarmAlert("参数错误", redirectUrl);

                TaskNodeBLL taskNodeBLL = new TaskNodeBLL();
                ResultModel result = taskNodeBLL.Get(User, taskNodeId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                TaskNode taskNode = result.ReturnValue as TaskNode;
                if (taskNode == null || taskNode.TaskNodeId <= 0 || taskNode.NodeStatus != StatusEnum.待审核 || taskNode.EmpId != User.EmpId)
                    Response.Redirect(redirectUrl);

                TaskBLL taskBLL = new TaskBLL();
                result = taskBLL.Get(User, taskNode.TaskId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                Task task = result.ReturnValue as Task;
                if (task.TaskStatus != StatusEnum.已生效)
                    Response.Redirect(redirectUrl);

                PledgeApplyBLL pledgeApplyBLL = new PledgeApplyBLL();
                result = pledgeApplyBLL.Get(User, id);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurPledgeApply = result.ReturnValue as PledgeApply;

                PledgeApplyCashDetailBLL pledgeApplyCashDetailBLL = new PledgeApplyCashDetailBLL();
                result = pledgeApplyCashDetailBLL.LoadByPledgeApplyId(User, id);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                List<PledgeApplyCashDetail> pledgeApplyCashDetails = result.ReturnValue as List<PledgeApplyCashDetail>;
                if (pledgeApplyCashDetails != null && pledgeApplyCashDetails.Any())
                    hasData = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string redirectUrl = "FinancingRepoApplyList.aspx";

                if (!UserOperate.Contains(OperateEnum.修改))
                    btnSave.Style.Add("display", "none");

                navigation1.Routes.Add("赎回申请单列表", redirectUrl);
                navigation1.Routes.Add("赎回申请单修改", string.Empty);

                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out repoApplyId) || repoApplyId <= 0)
                    this.WarmAlert("参数错误", redirectUrl);

                RepoApplyBLL repoApplyBLL = new RepoApplyBLL();
                ResultModel result = repoApplyBLL.Get(User, repoApplyId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurRepoApply = result.ReturnValue as RepoApply;
                if (CurRepoApply == null || CurRepoApply.RepoApplyId <= 0)
                    this.WarmAlert("获取赎回申请单错误", redirectUrl);

                PledgeApplyBLL pledgeApplyBLL = new PledgeApplyBLL();
                result = pledgeApplyBLL.Get(User, CurRepoApply.PledgeApplyId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurPledgeApply = result.ReturnValue as PledgeApply;
                if (CurPledgeApply == null || CurPledgeApply.PledgeApplyId <= 0)
                    this.WarmAlert("获取质押申请单错误", redirectUrl);

                FinService service = new FinService();
                selectedJsonUp = service.GetFinPledgeApplyStockDetailForRepoList(1, 500, "pasd.StockDetailId desc", CurPledgeApply.PledgeApplyId);

                selectedJsonDown = service.GetFinRepoApplyStockDetailForUpdateDown(1, 500, "rad.StockDetailId desc", CurPledgeApply.PledgeApplyId, repoApplyId);
            }
        }
Esempio n. 4
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            PledgeApply pledgeapply = new PledgeApply();

            int indexPledgeApplyId = dr.GetOrdinal("PledgeApplyId");
            pledgeapply.PledgeApplyId = Convert.ToInt32(dr[indexPledgeApplyId]);

            int indexPledgeApplyNo = dr.GetOrdinal("PledgeApplyNo");
            if (dr["PledgeApplyNo"] != DBNull.Value)
            {
                pledgeapply.PledgeApplyNo = Convert.ToString(dr[indexPledgeApplyNo]);
            }

            int indexDeptId = dr.GetOrdinal("DeptId");
            if (dr["DeptId"] != DBNull.Value)
            {
                pledgeapply.DeptId = Convert.ToInt32(dr[indexDeptId]);
            }

            int indexApplyTime = dr.GetOrdinal("ApplyTime");
            if (dr["ApplyTime"] != DBNull.Value)
            {
                pledgeapply.ApplyTime = Convert.ToDateTime(dr[indexApplyTime]);
            }

            int indexFinancingBankId = dr.GetOrdinal("FinancingBankId");
            if (dr["FinancingBankId"] != DBNull.Value)
            {
                pledgeapply.FinancingBankId = Convert.ToInt32(dr[indexFinancingBankId]);
            }

            int indexFinancingAccountId = dr.GetOrdinal("FinancingAccountId");
            if (dr["FinancingAccountId"] != DBNull.Value)
            {
                pledgeapply.FinancingAccountId = Convert.ToInt32(dr[indexFinancingAccountId]);
            }

            int indexAssetId = dr.GetOrdinal("AssetId");
            if (dr["AssetId"] != DBNull.Value)
            {
                pledgeapply.AssetId = Convert.ToInt32(dr[indexAssetId]);
            }

            int indexSwitchBack = dr.GetOrdinal("SwitchBack");
            if (dr["SwitchBack"] != DBNull.Value)
            {
                pledgeapply.SwitchBack = Convert.ToBoolean(dr[indexSwitchBack]);
            }

            int indexExchangeId = dr.GetOrdinal("ExchangeId");
            if (dr["ExchangeId"] != DBNull.Value)
            {
                pledgeapply.ExchangeId = Convert.ToInt32(dr[indexExchangeId]);
            }

            int indexSumNetAmount = dr.GetOrdinal("SumNetAmount");
            if (dr["SumNetAmount"] != DBNull.Value)
            {
                pledgeapply.SumNetAmount = Convert.ToDecimal(dr[indexSumNetAmount]);
            }

            int indexSumHands = dr.GetOrdinal("SumHands");
            if (dr["SumHands"] != DBNull.Value)
            {
                pledgeapply.SumHands = Convert.ToInt32(dr[indexSumHands]);
            }

            int indexPledgeApplyStatus = dr.GetOrdinal("PledgeApplyStatus");
            if (dr["PledgeApplyStatus"] != DBNull.Value)
            {
                pledgeapply.PledgeApplyStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexPledgeApplyStatus]);
            }

            int indexCreatorId = dr.GetOrdinal("CreatorId");
            if (dr["CreatorId"] != DBNull.Value)
            {
                pledgeapply.CreatorId = Convert.ToInt32(dr[indexCreatorId]);
            }

            int indexCreateTime = dr.GetOrdinal("CreateTime");
            if (dr["CreateTime"] != DBNull.Value)
            {
                pledgeapply.CreateTime = Convert.ToDateTime(dr[indexCreateTime]);
            }

            int indexLastModifyId = dr.GetOrdinal("LastModifyId");
            if (dr["LastModifyId"] != DBNull.Value)
            {
                pledgeapply.LastModifyId = Convert.ToInt32(dr[indexLastModifyId]);
            }

            int indexLastModifyTime = dr.GetOrdinal("LastModifyTime");
            if (dr["LastModifyTime"] != DBNull.Value)
            {
                pledgeapply.LastModifyTime = Convert.ToDateTime(dr[indexLastModifyTime]);
            }

            return pledgeapply;
        }
Esempio n. 5
0
        public override IModel CreateModel(DataRow dr)
        {
            PledgeApply pledgeapply = new PledgeApply();

            pledgeapply.PledgeApplyId = Convert.ToInt32(dr["PledgeApplyId"]);

            if (dr["PledgeApplyNo"] != DBNull.Value)
            {
                pledgeapply.PledgeApplyNo = Convert.ToString(dr["PledgeApplyNo"]);
            }

            if (dr["DeptId"] != DBNull.Value)
            {
                pledgeapply.DeptId = Convert.ToInt32(dr["DeptId"]);
            }

            if (dr["ApplyTime"] != DBNull.Value)
            {
                pledgeapply.ApplyTime = Convert.ToDateTime(dr["ApplyTime"]);
            }

            if (dr["FinancingBankId"] != DBNull.Value)
            {
                pledgeapply.FinancingBankId = Convert.ToInt32(dr["FinancingBankId"]);
            }

            if (dr["FinancingAccountId"] != DBNull.Value)
            {
                pledgeapply.FinancingAccountId = Convert.ToInt32(dr["FinancingAccountId"]);
            }

            if (dr["AssetId"] != DBNull.Value)
            {
                pledgeapply.AssetId = Convert.ToInt32(dr["AssetId"]);
            }

            if (dr["SwitchBack"] != DBNull.Value)
            {
                pledgeapply.SwitchBack = Convert.ToBoolean(dr["SwitchBack"]);
            }

            if (dr["ExchangeId"] != DBNull.Value)
            {
                pledgeapply.ExchangeId = Convert.ToInt32(dr["ExchangeId"]);
            }

            if (dr["SumNetAmount"] != DBNull.Value)
            {
                pledgeapply.SumNetAmount = Convert.ToDecimal(dr["SumNetAmount"]);
            }

            if (dr["SumHands"] != DBNull.Value)
            {
                pledgeapply.SumHands = Convert.ToInt32(dr["SumHands"]);
            }

            if (dr["PledgeApplyStatus"] != DBNull.Value)
            {
                pledgeapply.PledgeApplyStatus = (Common.StatusEnum)Convert.ToInt32(dr["PledgeApplyStatus"]);
            }

            if (dr["CreatorId"] != DBNull.Value)
            {
                pledgeapply.CreatorId = Convert.ToInt32(dr["CreatorId"]);
            }

            if (dr["CreateTime"] != DBNull.Value)
            {
                pledgeapply.CreateTime = Convert.ToDateTime(dr["CreateTime"]);
            }

            if (dr["LastModifyId"] != DBNull.Value)
            {
                pledgeapply.LastModifyId = Convert.ToInt32(dr["LastModifyId"]);
            }

            if (dr["LastModifyTime"] != DBNull.Value)
            {
                pledgeapply.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            }

            return pledgeapply;
        }
Esempio n. 6
0
        public string FinancingPledgeApplyCreate(UserModel user, PledgeApply pledgeApply, List<PledgeApplyStockDetail> details, bool isSubmitAudit)
        {
            ResultModel result = new ResultModel();
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    decimal SumNetAmount = 0;
                    int SumHands = 0;
                    if (details != null && details.Any())
                    {
                        foreach (PledgeApplyStockDetail detail in details)
                        {
                            SumNetAmount += detail.NetAmount;
                            SumHands += detail.Hands;
                        }
                    }

                    pledgeApply.SumNetAmount = SumNetAmount;
                    pledgeApply.SumHands = SumHands;

                    PledgeApplyDAL pledgeApplyDAL = new PledgeApplyDAL();
                    result = pledgeApplyDAL.Insert(user, pledgeApply);
                    if (result.ResultStatus != 0)
                        return serializer.Serialize(result);

                    int pledgeApplyId = (int)result.ReturnValue;

                    PledgeApplyStockDetailDAL pledgeApplyStockDetailDAL = new PledgeApplyStockDetailDAL();
                    StockNoDAL stockNoDAL = new StockNoDAL();
                    int stockId;
                    foreach (PledgeApplyStockDetail detail in details)
                    {
                        result = stockNoDAL.Insert(user, new StockNo()
                        {
                            RefNo = detail.RefNo.Trim(),
                            NetAmount = detail.NetAmount
                        });
                        stockId = (int)result.ReturnValue;

                        detail.RefNo = detail.RefNo.Trim();
                        detail.StockId = stockId;
                        detail.PledgeApplyId = pledgeApplyId;
                        result = pledgeApplyStockDetailDAL.Insert(user, detail);
                        if (result.ResultStatus != 0)
                            return serializer.Serialize(result);
                    }

                    if (result.ResultStatus == 0)
                    {
                        if (isSubmitAudit)
                        {
                            pledgeApply.PledgeApplyId = pledgeApplyId;

                            AutoSubmit submit = new AutoSubmit();
                            result = submit.Submit(user, pledgeApply, new PledgeApplyTaskProvider(), MasterEnum.质押申请单审核);
                        }

                        result.Message = "质押申请单新增成功";
                    }

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                this.log.ErrorFormat("FinService出错,出错方法:{0},{1}", "FinancingPledgeApplyCreate", ex.Message);
                result.Message = ex.Message;
                result.ResultStatus = -1;
            }

            return serializer.Serialize(result);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string redirectUrl = "FinancingRepoApplyList.aspx";

                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out repoApplyId) || repoApplyId <= 0)
                    this.WarmAlert("参数错误", redirectUrl);

                if (string.IsNullOrEmpty(Request.QueryString["taskNodeId"]) || !int.TryParse(Request.QueryString["taskNodeId"], out taskNodeId))
                    this.WarmAlert("参数错误", redirectUrl);

                TaskNodeBLL taskNodeBLL = new TaskNodeBLL();
                ResultModel result = taskNodeBLL.Get(User, taskNodeId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                TaskNode taskNode = result.ReturnValue as TaskNode;
                if (taskNode == null || taskNode.TaskNodeId <= 0 || taskNode.NodeStatus != StatusEnum.待审核 || taskNode.EmpId != User.EmpId)
                    Response.Redirect(redirectUrl);

                TaskBLL taskBLL = new TaskBLL();
                result = taskBLL.Get(User, taskNode.TaskId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                Task task = result.ReturnValue as Task;
                if (task.TaskStatus != StatusEnum.已生效)
                    Response.Redirect(redirectUrl);

                RepoApplyBLL repoApplyBLL = new RepoApplyBLL();
                result = repoApplyBLL.Get(User, repoApplyId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurRepoApply = result.ReturnValue as RepoApply;
                if (CurRepoApply == null || CurRepoApply.RepoApplyId <= 0)
                    this.WarmAlert("获取赎回申请单错误", redirectUrl);

                PledgeApplyBLL pledgeApplyBLL = new PledgeApplyBLL();
                result = pledgeApplyBLL.Get(User, CurRepoApply.PledgeApplyId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurPledgeApply = result.ReturnValue as PledgeApply;
                if (CurPledgeApply == null || CurPledgeApply.PledgeApplyId <= 0)
                    this.WarmAlert("获取质押申请单错误", redirectUrl);

                FinService service = new FinService();
                selectedJsonUp = service.GetFinPledgeApplyStockDetailForRepoList(1, 500, "pasd.StockDetailId desc", CurPledgeApply.PledgeApplyId);

                selectedJsonDown = service.GetFinRepoApplyStockDetailForUpdateDown(1, 500, "rad.StockDetailId desc", CurPledgeApply.PledgeApplyId, repoApplyId);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!UserOperate.Contains(OperateEnum.提交审核))
                    btnAudit.Style.Add("display", "none");
                if (!UserOperate.Contains(OperateEnum.作废))
                    btnInvalid.Style.Add("display", "none");
                if (!UserOperate.Contains(OperateEnum.撤返))
                    btnGoBack.Style.Add("display", "none");

                string redirectUrl = "FinancingRepoApplyList.aspx";

                navigation1.Routes.Add("赎回申请单列表", redirectUrl);
                navigation1.Routes.Add("赎回申请单明细", string.Empty);

                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out repoApplyId) || repoApplyId <= 0)
                    this.WarmAlert("参数错误", redirectUrl);

                RepoApplyBLL repoApplyBLL = new RepoApplyBLL();
                ResultModel result = repoApplyBLL.Get(User, repoApplyId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurRepoApply = result.ReturnValue as RepoApply;
                if (CurRepoApply == null || CurRepoApply.RepoApplyId <= 0)
                    this.WarmAlert("获取赎回申请单错误", redirectUrl);

                PledgeApplyBLL pledgeApplyBLL = new PledgeApplyBLL();
                result = pledgeApplyBLL.Get(User, CurRepoApply.PledgeApplyId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                CurPledgeApply = result.ReturnValue as PledgeApply;
                if (CurPledgeApply == null || CurPledgeApply.PledgeApplyId <= 0)
                    this.WarmAlert("获取质押申请单错误", redirectUrl);

                FinService service = new FinService();
                selectedJsonUp = service.GetFinPledgeApplyStockDetailForRepoList(1, 500, "pasd.StockDetailId desc", CurPledgeApply.PledgeApplyId);

                selectedJsonDown = service.GetFinRepoApplyStockDetailForUpdateDown(1, 500, "rad.StockDetailId desc", CurPledgeApply.PledgeApplyId, repoApplyId);

                JavaScriptSerializer serializer = new JavaScriptSerializer();
                string json = serializer.Serialize(CurRepoApply);
                hidModel.Value = json;

                NFMT.Finance.EmailInfoProvider provider = new NFMT.Finance.EmailInfoProvider(NFMT.Finance.FinType.赎回, repoApplyId);
                result = provider.GetEmailInfo(User);
                if (result.ResultStatus == 0)
                    emailStr = result.ReturnValue.ToString();
            }
        }