Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            context.Response.ContentType = "text/plain";

            string blocName = context.Request.Form["name"];
            string blocEName = context.Request.Form["ename"];
            string blocFName = context.Request.Form["fname"];

            string resultStr = "添加失败";

            if (string.IsNullOrEmpty(blocName))
            {
                resultStr = "集团名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(blocEName))
            {
                resultStr = "集团英文名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

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

            bool isSelf = true;
            NFMT.User.BLL.BlocBLL blocBLL = new NFMT.User.BLL.BlocBLL();
            NFMT.Common.ResultModel result = blocBLL.IsExistSelfBolc(user);
            if (result.ResultStatus != 0)
                isSelf = false;

            NFMT.User.Model.Bloc bloc = new NFMT.User.Model.Bloc()
            {
                BlocName = blocName,
                BlocEname = blocEName,
                BlocFullName = blocFName,
                IsSelf = isSelf
            };

            result = blocBLL.Insert(user, bloc);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
Пример #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.User.BLL.BlocBLL blocBLL = new NFMT.User.BLL.BlocBLL();
            NFMT.User.Model.Bloc bloc = new NFMT.User.Model.Bloc()
            {
                LastModifyId = user.EmpId,
                BlocId = id
            };

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

            switch (operateEnum)
            {
                case NFMT.Common.OperateEnum.作废:
                    result = blocBLL.Invalid(user, bloc);
                    break;
                case NFMT.Common.OperateEnum.撤返:
                    result = blocBLL.GoBack(user, bloc);
                    break;
                case NFMT.Common.OperateEnum.冻结:
                    result = blocBLL.Freeze(user, bloc);
                    break;
                case NFMT.Common.OperateEnum.解除冻结:
                    result = blocBLL.UnFreeze(user, bloc);
                    break;
            }

            context.Response.Write(result.Message);
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            context.Response.ContentType = "text/plain";

            string blocName = context.Request.Form["name"];
            string blocEName = context.Request.Form["ename"];
            string blocFName = context.Request.Form["fname"];
            int id = 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(blocName))
            {
                resultStr = "集团名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(blocEName))
            {
                resultStr = "集团英文名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

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

            NFMT.User.BLL.BlocBLL blocBLL = new NFMT.User.BLL.BlocBLL();

            NFMT.User.Model.Bloc bloc = new NFMT.User.Model.Bloc();
            bloc.BlocId = id;
            bloc.BlocName = blocName;
            bloc.BlocEname = blocEName;
            bloc.BlocFullName = blocFName;

            var result = blocBLL.Update(user, bloc);
            resultStr = result.Message;

            context.Response.Write(resultStr);
            context.Response.End();
        }