예제 #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string resultStr = "更新失败";

            int detailId = 0;
            string detailCode = context.Request.Form["code"];
            string detailName = context.Request.Form["name"];

            if (string.IsNullOrEmpty(context.Request.Form["detailId"]))
            {
                context.Response.Write("明细序号未知");
                context.Response.End();
            }
            if (string.IsNullOrEmpty(detailCode))
            {
                context.Response.Write("明细编号不能为空");
                context.Response.End();
            }
            if (string.IsNullOrEmpty(detailName))
            {
                context.Response.Write("明细名称不能为空");
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["detailId"], out detailId))
            {
                context.Response.Write("明细序号未知");
                context.Response.End();
            }

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            NFMT.Data.Model.BDStyleDetail detail = new NFMT.Data.Model.BDStyleDetail();
            detail.StyleDetailId = detailId;
            detail.DetailCode = detailCode;
            detail.DetailName = detailName;

            int status = 0;
            if (!string.IsNullOrEmpty(context.Request.Form["status"]))
                int.TryParse(context.Request.Form["status"], out status);

            if (status <= 0)
            {
                context.Response.Write("明细状态未知");
                context.Response.End();
            }

            NFMT.Common.StatusEnum st = (NFMT.Common.StatusEnum)status;

            detail.DetailStatus = st;
            NFMT.Data.BLL.BDStyleDetailBLL bll = new NFMT.Data.BLL.BDStyleDetailBLL();
            NFMT.Common.ResultModel result = bll.Update(user, detail);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string detailCode = context.Request.Form["code"];
            string detailName = context.Request.Form["name"];
            int styleId = 0;

            string resultStr = "添加失败";

            if (string.IsNullOrEmpty(context.Request.Form["pid"]))
            {
                resultStr = "父类型未知";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["pid"], out styleId))
            {
                resultStr = "父类型未知";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(detailCode))
            {
                resultStr = "明细编号不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(detailName))
            {
                resultStr = "明细名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            NFMT.Data.BLL.BDStyleDetailBLL bll = new NFMT.Data.BLL.BDStyleDetailBLL();
            NFMT.Data.Model.BDStyleDetail detail = new NFMT.Data.Model.BDStyleDetail();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            detail.CreatorId = user.EmpId;
            detail.BDStyleId = styleId;
            detail.DetailCode = detailCode;
            detail.DetailName = detailName;
            detail.DetailStatus = NFMT.Common.StatusEnum.已录入;

            NFMT.Common.ResultModel result = bll.Insert(user, detail);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
예제 #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            int detailId = 0;
            int operateId = 0;

            if (string.IsNullOrEmpty(context.Request.Form["id"]))
            {
                context.Response.Write("类型明细序号错误");
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["id"], out detailId) || detailId <= 0)
            {
                context.Response.Write("类型明细序号错误");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["oi"]))
            {
                context.Response.Write("操作错误");
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["oi"], out operateId) || operateId <= 0)
            {
                context.Response.Write("操作错误");
                context.Response.End();
            }

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Data.BLL.BDStyleDetailBLL bll = new NFMT.Data.BLL.BDStyleDetailBLL();
            NFMT.Data.Model.BDStyleDetail detail = new NFMT.Data.Model.BDStyleDetail();
            detail.LastModifyId = user.EmpId;
            detail.StyleDetailId = detailId;

            NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            switch (operateEnum)
            {
                case NFMT.Common.OperateEnum.冻结:
                    result = bll.Freeze(user, detail);
                    break;
                case NFMT.Common.OperateEnum.解除冻结:
                    result = bll.UnFreeze(user, detail);
                    break;
            }

            context.Response.Write(result.Message);
        }
예제 #4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string resultStr = "更新失败";

            int detailId = 0;
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            if (!int.TryParse(context.Request.Form["detailId"], out detailId))
            {
                context.Response.Write("明细序号未知");
                context.Response.End();
            }

            NFMT.Data.Model.BDStyleDetail detail = new NFMT.Data.Model.BDStyleDetail();
            detail.StyleDetailId = detailId;

            NFMT.Data.BLL.BDStyleDetailBLL bll = new NFMT.Data.BLL.BDStyleDetailBLL();
            NFMT.Common.ResultModel result = bll.Freeze(user, detail);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }