예제 #1
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            int pageIndex = 0, pageSize = 10;
            string orderStr = string.Empty;

            int issueBank = 0;
            if (!string.IsNullOrEmpty(context.Request["i"]))
                int.TryParse(context.Request["i"], out issueBank);

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

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

            DateTime datef = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request["df"]))
                DateTime.TryParse(context.Request["df"], out datef);

            DateTime datet = NFMT.Common.DefaultValue.DefaultTime;
            if (!string.IsNullOrEmpty(context.Request["dt"]))
                DateTime.TryParse(context.Request["dt"], out datet);

            if (!string.IsNullOrEmpty(context.Request.QueryString["page"]))
                int.TryParse(context.Request.QueryString["page"].Trim(), out pageIndex);
            pageIndex++;
            if (!string.IsNullOrEmpty(context.Request.QueryString["rows"]))
                int.TryParse(context.Request.QueryString["rows"].Trim(), 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.Contract.BLL.LcBLL lcBLL = new NFMT.Contract.BLL.LcBLL();
            NFMT.Common.SelectModel select = lcBLL.GetSelectModel(pageIndex, pageSize, orderStr, issueBank, adviseBank, status, datef, datet);
            NFMT.Common.ResultModel result = lcBLL.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);
        }
예제 #2
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;
                }
            }
        }
예제 #3
0
        public void ProcessRequest(HttpContext context)
        {
            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.Contract.BLL.LcBLL lcBLL = new NFMT.Contract.BLL.LcBLL();
            NFMT.Contract.Model.Lc lc = new NFMT.Contract.Model.Lc()
            {
                LastModifyId = user.EmpId,
                LcId = id
            };

            NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            switch (operateEnum)
            {
                case NFMT.Common.OperateEnum.作废:
                    result = lcBLL.Invalid(user, lc);
                    break;
                case NFMT.Common.OperateEnum.撤返:
                    result = lcBLL.GoBack(user, lc);
                    break;
                case NFMT.Common.OperateEnum.冻结:
                    result = lcBLL.Freeze(user, lc);
                    break;
                case NFMT.Common.OperateEnum.解除冻结:
                    result = lcBLL.UnFreeze(user, lc);
                    break;
            }

            context.Response.Write(result.Message);
        }
예제 #4
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();
                }
            }
        }
예제 #5
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

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

            if (string.IsNullOrEmpty(context.Request.Form["lcid"]))
            {
                context.Response.Write("序号不能为空");
                context.Response.End();
            }
            int lcid = 0;
            if (!int.TryParse(context.Request.Form["lcid"], out lcid))
            {
                context.Response.Write("序号转换失败");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["issueBank"]))
            {
                context.Response.Write("开证行不能为空");
                context.Response.End();
            }
            int issueBank = 0;
            if (!int.TryParse(context.Request.Form["issueBank"], out issueBank))
            {
                context.Response.Write("开证行转换失败");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["adviseBank"]))
            {
                context.Response.Write("通知行不能为空");
                context.Response.End();
            }
            int adviseBank = 0;
            if (!int.TryParse(context.Request.Form["adviseBank"], out adviseBank))
            {
                context.Response.Write("通知行转换失败");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["issueDate"]))
            {
                context.Response.Write("开证日期不能为空");
                context.Response.End();
            }
            DateTime issueDate = NFMT.Common.DefaultValue.DefaultTime;
            if (!DateTime.TryParse(context.Request.Form["issueDate"], out issueDate))
            {
                context.Response.Write("开证日期转换失败");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["futureDay"]))
            {
                context.Response.Write("远期天数不能为空");
                context.Response.End();
            }
            int futureDay = 0;
            if (!int.TryParse(context.Request.Form["futureDay"], out futureDay))
            {
                context.Response.Write("远期天数转换失败");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["lcBala"]))
            {
                context.Response.Write("信用证金额不能为空");
                context.Response.End();
            }
            decimal lcBala = 0;
            if (!decimal.TryParse(context.Request.Form["lcBala"], out lcBala))
            {
                context.Response.Write("信用证金额转换失败");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["currency"]))
            {
                context.Response.Write("信用证币种不能为空");
                context.Response.End();
            }
            int currency = 0;
            if (!int.TryParse(context.Request.Form["currency"], out currency))
            {
                context.Response.Write("信用证币种转换失败");
                context.Response.End();
            }

            string resultStr = "添加失败";

            NFMT.Contract.Model.Lc lc = new NFMT.Contract.Model.Lc();
            lc.LcId = lcid;
            lc.IssueBank = issueBank;
            lc.AdviseBank = adviseBank;
            lc.IssueDate = issueDate;
            lc.FutureDay = futureDay;
            lc.LcBala = lcBala;
            lc.Currency = currency;

            NFMT.Contract.BLL.LcBLL lcBLL = new NFMT.Contract.BLL.LcBLL();
            var result = lcBLL.Update(user, lc);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
예제 #6
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);
        }