protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 26, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); this.navigation1.Routes.Add("汇率管理", string.Format("{0}BasicData/RateList.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("汇率修改", string.Empty); int rateId = 0; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { if (int.TryParse(Request.QueryString["id"], out rateId)) { if (rateId == 0) Response.Redirect("RateList.aspx"); NFMT.Data.BLL.RateBLL rateBLL = new NFMT.Data.BLL.RateBLL(); var result = rateBLL.Get(user, rateId); if (result.ResultStatus != 0) Response.Redirect("RateList.aspx"); rate = result.ReturnValue as NFMT.Data.Model.Rate; } } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string reatDate = context.Request.Form["reatDate"]; int currency1 = 0; string rateValue = context.Request.Form["rateValue"]; int currency2 = 0; string resultStr = "添加失败"; if (string.IsNullOrEmpty(reatDate)) { resultStr = "汇率日期不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (!int.TryParse(context.Request.Form["currency1"], out currency1)) { resultStr = "币种1不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (string.IsNullOrEmpty(rateValue)) { resultStr = "汇率不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (!int.TryParse(context.Request.Form["currency2"], out currency2)) { resultStr = "币种2不能为空"; context.Response.Write(resultStr); context.Response.End(); } NFMT.Data.BLL.RateBLL bll = new NFMT.Data.BLL.RateBLL(); NFMT.Data.Model.Rate rate = new NFMT.Data.Model.Rate(); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; //master.BankName = bankName; //master.ParentId = Convert.ToInt32(parentId); rate.CreateTime =Convert.ToDateTime(reatDate); rate.FromCurrencyId = Convert.ToInt32(currency1); rate.ToCurrencyId = Convert.ToInt32(currency2); rate.RateValue =Convert.ToDecimal(rateValue); rate.RateStatus = NFMT.Common.StatusEnum.已录入; NFMT.Common.ResultModel result = bll.Insert(user, rate); resultStr = result.Message; context.Response.Write(resultStr); }
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.Data.BLL.RateBLL reatbll = new NFMT.Data.BLL.RateBLL(); NFMT.Data.Model.Rate rate = new NFMT.Data.Model.Rate() { RateId = id, LastModifyId = user.EmpId }; NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); switch (operateEnum) { case NFMT.Common.OperateEnum.冻结: result = reatbll.Freeze(user, rate); break; case NFMT.Common.OperateEnum.解除冻结: result = reatbll.UnFreeze(user, rate); break; } context.Response.Write(result.Message); }