public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string exchangeName = context.Request.Form["exchangeName"]; string exchangeCode = context.Request.Form["exchangeCode"]; string resultStr = "添加失败"; if (string.IsNullOrEmpty(exchangeName)) { resultStr = "交易所名称不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (string.IsNullOrEmpty(exchangeCode)) { resultStr = "交易所代码不能为空"; context.Response.Write(resultStr); context.Response.End(); } NFMT.Data.BLL.ExchangeBLL ecBLL = new NFMT.Data.BLL.ExchangeBLL(); NFMT.Data.Model.Exchange ec = new NFMT.Data.Model.Exchange(); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; ec.ExchangeName = exchangeName; ec.ExchangeCode = exchangeCode; ec.ExchangeStatus = NFMT.Common.StatusEnum.已录入; NFMT.Common.ResultModel result = ecBLL.Insert(user, ec); resultStr = result.Message; context.Response.Write(resultStr); }
public void ProcessRequest(HttpContext context) { int status = -1; int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; string key = context.Request["exchangeName"];//交易所名称模糊搜索 if (!string.IsNullOrEmpty(context.Request["exchangeStatus"])) int.TryParse(context.Request["exchangeStatus"], out status);//状态查询条件 string exchangeCode = context.Request["exchangeCode"];//交易所代码模糊搜索 if (!string.IsNullOrEmpty(context.Request.QueryString["page"])) int.TryParse(context.Request.QueryString["page"].Trim(), out pageIndex); if (!string.IsNullOrEmpty(context.Request.QueryString["rows"])) int.TryParse(context.Request.QueryString["rows"].Trim(), out pageSize); //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 sortDataField = context.Request.QueryString["sortdatafield"].Trim(); string sortOrder = context.Request.QueryString["sortorder"].Trim(); orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } NFMT.Data.BLL.ExchangeBLL exchangeBLL = new NFMT.Data.BLL.ExchangeBLL(); NFMT.Common.SelectModel select = exchangeBLL.GetSelectModel(pageIndex, pageSize, orderStr, status, key, exchangeCode); NFMT.Common.ResultModel result = exchangeBLL.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 postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(postData); }
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.ExchangeBLL ec = new NFMT.Data.BLL.ExchangeBLL(); NFMT.Data.Model.Exchange exchange = new NFMT.Data.Model.Exchange() { ExchangeId = 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 = ec.Freeze(user, exchange); break; case NFMT.Common.OperateEnum.解除冻结: result = ec.UnFreeze(user, exchange); break; } context.Response.Write(result.Message); }
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, 33, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.冻结, NFMT.Common.OperateEnum.解除冻结 }); this.navigation1.Routes.Add("交易所管理", string.Format("{0}BasicData/ExchangeList.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("ExchangeList.aspx"); NFMT.Data.BLL.ExchangeBLL exchangeBLL = new NFMT.Data.BLL.ExchangeBLL(); var result = exchangeBLL.Get(user, id); if (result.ResultStatus != 0) Response.Redirect("ExchangeList.aspx"); NFMT.Data.Model.Exchange ec = result.ReturnValue as NFMT.Data.Model.Exchange; if (ec != null) { this.txbExchangeName.InnerText = ec.ExchangeName; this.txbExchangeCode.InnerText = ec.ExchangeCode; this.StatusName.InnerText = ec.ExchangeStatusName; this.hidId.Value = ec.ExchangeId.ToString(); } } } } }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; context.Response.ContentType = "text/plain"; string exchangeName = context.Request.Form["exchangeName"]; string exchangeCode = context.Request.Form["exchangeCode"]; int id = 0; int statusName = 0; string resultStr = "修改失败"; if (string.IsNullOrEmpty(context.Request.Form["id"])) { resultStr = "id未知"; context.Response.Write(resultStr); context.Response.End(); } if (!int.TryParse(context.Request.Form["id"], out id)) { resultStr = "id未知"; context.Response.Write(resultStr); context.Response.End(); } if (!int.TryParse(context.Request.Form["statusName"], out statusName)) { resultStr = "交易所状态不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (string.IsNullOrEmpty(exchangeName)) { resultStr = "交易所名称不可为空"; context.Response.Write(resultStr); context.Response.End(); } if (string.IsNullOrEmpty(exchangeCode)) { resultStr = "交易所代码不可为空"; context.Response.Write(resultStr); context.Response.End(); } NFMT.Data.BLL.ExchangeBLL ecBLL = new NFMT.Data.BLL.ExchangeBLL(); NFMT.Data.Model.Exchange exchange = new NFMT.Data.Model.Exchange() { ExchangeName = exchangeName, ExchangeCode = exchangeCode, ExchangeId = id, ExchangeStatus = (NFMT.Common.StatusEnum)statusName }; NFMT.Common.ResultModel result = ecBLL.Update(user, exchange); if (result.ResultStatus == 0) context.Response.Write("修改成功"); else context.Response.Write(resultStr); }