예제 #1
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}Contract/LcList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("信用证管理", redirectURL);
                this.navigation1.Routes.Add("信用证明细", string.Empty);

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

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

                this.hidId.Value = lcId.ToString();

                NFMT.Contract.BLL.LcBLL lcBLL = new NFMT.Contract.BLL.LcBLL();
                NFMT.Common.ResultModel result = lcBLL.Get(user, lcId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                NFMT.Contract.Model.Lc lc = result.ReturnValue as NFMT.Contract.Model.Lc;
                if (lc != null)
                {
                    NFMT.Data.Model.Bank aviseBank = NFMT.Data.BasicDataProvider.Banks.FirstOrDefault(temp => temp.BankId == lc.AdviseBank);
                    if (aviseBank != null && aviseBank.BankId > 0)
                        this.ddlAdviseBank.InnerText = aviseBank.BankName;//lc.AviseBankName.ToString();

                    NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == lc.Currency);
                    if (currency != null && currency.CurrencyId > 0)
                        this.ddlCurrency.InnerText = currency.CurrencyName;//lc.CurrencyName.ToString();

                    this.nbFutureDay.InnerText = lc.FutureDayName.ToString();

                    NFMT.Data.Model.Bank issueBank = NFMT.Data.BasicDataProvider.Banks.FirstOrDefault(temp => temp.BankId == lc.IssueBank);
                    if (issueBank != null && issueBank.BankId > 0)
                        this.ddlIssueBank.InnerText = issueBank.BankName;//lc.IssueBankName.ToString();
                    this.dtIssueDate.InnerText = lc.IssueDate.ToShortDateString();
                    this.nbLcBala.InnerText = lc.LcBalaName.ToString();

                    NFMT.Common.IModel model = lc;
                    string json = serializer.Serialize(model);
                    this.hidModel.Value = json;
                }
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectURL = string.Format("{0}Contract/LcList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("信用证管理", redirectURL);
                this.navigation1.Routes.Add("信用证修改", string.Empty);

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

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

                this.hidId.Value = lcId.ToString();

                NFMT.Contract.BLL.LcBLL lcBLL = new NFMT.Contract.BLL.LcBLL();
                NFMT.Common.ResultModel result = lcBLL.Get(user, lcId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectURL);

                NFMT.Contract.Model.Lc lc = result.ReturnValue as NFMT.Contract.Model.Lc;
                if (lc != null)
                {
                    this.hidAdviseBank.Value = lc.AdviseBank.ToString();
                    this.hidCurrency.Value = lc.Currency.ToString();
                    this.hidFutureDay.Value = lc.FutureDay.ToString();
                    this.hidIssueBank.Value = lc.IssueBank.ToString();
                    this.hidIssueDate.Value = lc.IssueDate.ToShortDateString();
                    this.hidLcBala.Value = lc.LcBala.ToString();
                }
            }
        }
예제 #3
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            context.Response.ContentType = "text/plain";

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

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

            NFMT.Contract.BLL.LcBLL lcBLL = new NFMT.Contract.BLL.LcBLL();
            NFMT.Common.ResultModel result = lcBLL.Get(user, id);
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            NFMT.Contract.Model.Lc lc = result.ReturnValue as NFMT.Contract.Model.Lc;

            NFMT.WorkFlow.BLL.FlowMasterBLL flowMasterBLL = new NFMT.WorkFlow.BLL.FlowMasterBLL();
            result = flowMasterBLL.Get(user, masterId);
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            NFMT.WorkFlow.Model.FlowMaster flowMaster = result.ReturnValue as NFMT.WorkFlow.Model.FlowMaster;

            NFMT.WorkFlow.Model.DataSource source = new NFMT.WorkFlow.Model.DataSource()
            {
                //DataBaseName = "NFMT",
                TableName = "dbo.Con_Lc",
                DataStatus = NFMT.Common.StatusEnum.待审核,
                RowId = id,//BlocId
                ViewUrl = flowMaster.ViewUrl,
                EmpId = user.EmpId,
                ApplyTime = DateTime.Now,
                ApplyTitle = string.Empty,
                ApplyMemo = string.Empty,
                ApplyInfo = string.Empty,
                RefusalUrl = flowMaster.RefusalUrl,
                SuccessUrl = flowMaster.SuccessUrl,
                DalName = string.IsNullOrEmpty(lc.DalName) ? "NFMT.Contract.DAL.LcDAL" : lc.DalName,
                AssName = string.IsNullOrEmpty(lc.AssName) ? "NFMT.Contract" : lc.AssName
            };

            NFMT.WorkFlow.Model.Task task = new NFMT.WorkFlow.Model.Task()
            {
                MasterId = masterId,
                TaskName = string.Format("开证行:{0} 开证日期:{1}", lc.IssueBankName, lc.IssueDate.ToShortDateString())
            };

            result = lcBLL.Submit(user, new NFMT.Contract.Model.Lc() { Id = id });
            if (result.ResultStatus != 0)
            {
                context.Response.Write(result.Message);
                context.Response.End();
            }

            //NFMT.WorkFlow.FlowOperate flowOperate = new NFMT.WorkFlow.FlowOperate();
            //result = flowOperate.CreateTask(user, flowMaster, source, task);
            //if (result.ResultStatus == 0)
            //    context.Response.Write("提交审核成功");
            //else
            //    context.Response.Write(result.Message);
        }