Exemplo n.º 1
0
        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, 34, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                this.navigation1.Routes.Add("期货合约管理", string.Format("{0}BasicData/FuturesCodeList.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("FuturesCodeList.aspx");

                        NFMT.Data.BLL.FuturesCodeBLL bBLL = new NFMT.Data.BLL.FuturesCodeBLL();
                        var result = bBLL.Get(user, id);
                        if (result.ResultStatus != 0)
                            Response.Redirect("FuturesCodeList.aspx");

                        NFMT.Data.Model.FuturesCode fC = result.ReturnValue as NFMT.Data.Model.FuturesCode;
                        if (fC != null)
                        {
                           // this.hidBirthday.Value = emp.BirathDay.ToString("yyyy-MM-dd");
                            this.txbCodeSize.Value = fC.CodeSize.ToString();
                            this.txbTradeCode.Value = fC.TradeCode.ToString();

                            this.hidFirstTradeDate.Value = fC.FirstTradeDate.ToString("yyyy-MM-dd");
                            this.hidLastTradeDate.Value = fC.LastTradeDate.ToString("yyyy-MM-dd");
                            this.hidMU.Value = fC.MUId.ToString();
                            this.hidCurrency.Value = fC.CurrencyId.ToString();
                            this.hidExchage.Value = fC.ExchageId.ToString();

                            this.hidFuturesCodeStatus.Value = ((int)fC.FuturesCodeStatus).ToString();

                            this.curFuturesCode = fC;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
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.Data.BLL.FuturesCodeBLL fcBLL = new NFMT.Data.BLL.FuturesCodeBLL();
            NFMT.Data.Model.FuturesCode fc = new NFMT.Data.Model.FuturesCode()
            {
                FuturesCodeId = 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 = fcBLL.Freeze(user, fc);
                    break;
                case NFMT.Common.OperateEnum.解除冻结:
                    result = fcBLL.UnFreeze(user, fc);
                    break;
            }

            context.Response.Write(result.Message);
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            context.Response.ContentType = "text/plain";
            DateTime firstTradeDate = NFMT.Common.DefaultValue.DefaultTime;
            DateTime lastTradeDate = NFMT.Common.DefaultValue.DefaultTime;

            decimal codeSize =Convert.ToDecimal(context.Request.Form["codeSize"]);
            string tradeCode = context.Request.Form["tradeCode"];
            int exchage = 0;
            int id = 0;
            int mU = 0;
            int currency = 0;
            int futuresCodeStatus = 0;
            int assetId = 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 (!string.IsNullOrEmpty(context.Request.Form["firstTradeDate"]))
            {
                if (!DateTime.TryParse(context.Request.Form["firstTradeDate"], out firstTradeDate))
                {
                    resultStr = "交易起始日期不能为空";
                    context.Response.Write(resultStr);
                    context.Response.End();
                }
            }

            if (!string.IsNullOrEmpty(context.Request.Form["lastTradeDate"]))
            {
                if (!DateTime.TryParse(context.Request.Form["lastTradeDate"], out lastTradeDate))
                {
                    resultStr = "交易结束日期不能为空";
                    context.Response.Write(resultStr);
                    context.Response.End();
                }
            }

            if (!int.TryParse(context.Request.Form["exchage"], out exchage))
            {
                resultStr = "交易所序号不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["futuresCodeStatus"], out futuresCodeStatus))
            {
                resultStr = "合约状态序号不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["currency"], out currency))
            {
                resultStr = "币种序号不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["mU"], out mU))
            {
                resultStr = "计量单位序号不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(tradeCode))
            {
                resultStr = "交易代码不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["assetId"]) || !int.TryParse(context.Request.Form["assetId"], out assetId) || assetId <= 0)
            {
                resultStr = "品种不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            NFMT.Data.BLL.FuturesCodeBLL bll = new NFMT.Data.BLL.FuturesCodeBLL();
            NFMT.Data.Model.FuturesCode futuresCode = new NFMT.Data.Model.FuturesCode()
            {
                FirstTradeDate = firstTradeDate,
                LastTradeDate = lastTradeDate,
                MUId = mU,
                CurrencyId = currency,
                FuturesCodeId = id,
                ExchageId = exchage,
                CodeSize = codeSize,
                TradeCode = tradeCode,
                AssetId = assetId,
                FuturesCodeStatus = (NFMT.Common.StatusEnum)futuresCodeStatus
            };
            NFMT.Common.ResultModel result = bll.Update(user, futuresCode);
            if (result.ResultStatus == 0)
                context.Response.Write("更新成功");
            else
                context.Response.Write(resultStr);
        }
Exemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            int codeSize = 0;
            string tradeCode = context.Request.Form["tradeCode"];
            int exchage = 0;
            DateTime firstTradeDate =Convert.ToDateTime(context.Request.Form["firstTradeDate"]);
            DateTime lastTradeDate = Convert.ToDateTime(context.Request.Form["lastTradeDate"]);
            int mU = 0;
            int currency = 0;
            int assetId = 0;

            string resultStr = "添加失败";

            if (string.IsNullOrEmpty(tradeCode))
            {
                resultStr = "交易代码不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["codeSize"], out codeSize))
            {
                resultStr = "交易规模不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["exchage"], out exchage))
            {
                resultStr = "交易所不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["mU"], out mU))
            {
                resultStr = "合约单位不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["currency"], out currency))
            {
                resultStr = "币种不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["assetId"]) || !int.TryParse(context.Request.Form["assetId"], out assetId) || assetId <= 0)
            {
                resultStr = "品种不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            NFMT.Data.BLL.FuturesCodeBLL fcBLL = new NFMT.Data.BLL.FuturesCodeBLL();
            NFMT.Data.Model.FuturesCode fc = new NFMT.Data.Model.FuturesCode();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            fc.CodeSize = codeSize;
            fc.TradeCode = tradeCode;
            fc.FirstTradeDate = firstTradeDate;
            fc.LastTradeDate = lastTradeDate;
            fc.ExchageId = exchage;
            fc.MUId = mU;
            fc.AssetId = assetId;
            fc.CurrencyId = currency;

            fc.FuturesCodeStatus = NFMT.Common.StatusEnum.已录入;

            NFMT.Common.ResultModel result = fcBLL.Insert(user, fc);
            resultStr = result.Message;
            context.Response.Write(resultStr);
        }