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, 27, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); this.navigation1.Routes.Add("银行管理", string.Format("{0}BasicData/BankList.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("银行修改", string.Empty); int id = 0; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { if (int.TryParse(Request.QueryString["id"], out id)) { if (id == 0) Response.Redirect("BankList.aspx"); NFMT.Data.BLL.BankBLL bBLL = new NFMT.Data.BLL.BankBLL(); var result = bBLL.Get(user, id); if (result.ResultStatus != 0) Response.Redirect("BankList.aspx"); bank = result.ReturnValue as NFMT.Data.Model.Bank; int styleId = (int)NFMT.Data.StyleEnum.CapitalType; this.hidStyleId.Value = styleId.ToString(); } } } }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); context.Response.ContentType = "text/plain"; string bankStr = context.Request.Form["bank"]; if (string.IsNullOrEmpty(bankStr)) { context.Response.Write("银行信息为空"); context.Response.End(); } try { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); NFMT.Data.Model.Bank bank = serializer.Deserialize<NFMT.Data.Model.Bank>(bankStr); if (bank == null) { context.Response.Write("数据错误"); context.Response.End(); } NFMT.Data.BLL.BankBLL bll = new NFMT.Data.BLL.BankBLL(); result = bll.Update(user, bank); if (result.ResultStatus == 0) { result.Message = "修改成功"; } } catch (Exception ex) { result.ResultStatus = -1; result.Message = ex.Message; } context.Response.Write(result.Message); }
public void ProcessRequest(HttpContext context) { int status = -1; int pageIndex = 1, pageSize = 10; int bankeStatus = 0; int capitalType = 0; string orderStr = string.Empty, whereStr = string.Empty; string key = context.Request["k"];//模糊搜索 string bankEname = context.Request["bankEname"];//模糊搜索英文名称 if (!string.IsNullOrEmpty(context.Request["s"])) int.TryParse(context.Request["s"], out status); if (!string.IsNullOrEmpty(context.Request["bankeStatus"])) int.TryParse(context.Request["bankeStatus"], out bankeStatus); if (!string.IsNullOrEmpty(context.Request["capitalType"])) int.TryParse(context.Request["capitalType"], out capitalType); //jqwidgets jqxGrid 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 sortDataFields = context.Request.QueryString["sortdatafield"].Trim(); string sortOrders = context.Request.QueryString["sortorder"].Trim(); switch (sortDataFields) { case "BankName": sortDataFields = "B.BankName"; break; case "BankEname": sortDataFields = "B.BankEname"; break; case "BankFullName": sortDataFields = "B.BankFullName"; break; case "BankShort": sortDataFields = "B.BankShort"; break; case "ParentBankName": sortDataFields = "bt.BankName"; break; } orderStr = string.Format("{0} {1}", sortDataFields, sortOrders); } NFMT.Data.BLL.BankBLL bkBLL = new NFMT.Data.BLL.BankBLL(); NFMT.Common.SelectModel select = bkBLL.GetSelectModel(pageIndex, pageSize, orderStr, status, key, bankeStatus, capitalType, bankEname); NFMT.Common.ResultModel result = bkBLL.Load(new NFMT.Common.UserModel(), select); context.Response.ContentType = "text/plain"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; Dictionary<string, object> dic = new Dictionary<string, object>(); //jqwidgets dic.Add("count", result.AffectCount); dic.Add("data", dt); string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(jsonStr); }