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)
        {
            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);
        }
        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);
        }