public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            string masterName = context.Request.Form["mn"];
            string masterEname = context.Request.Form["men"];

            if (string.IsNullOrEmpty(masterName))
            {
                result.Message = "合约模板名称不能为空";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

            if (string.IsNullOrEmpty(masterEname))
            {
                result.Message = "合约模板英文名称不能为空";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

            NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
            NFMT.Data.Model.ContractMaster master = new NFMT.Data.Model.ContractMaster();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            master.CreatorId = user.EmpId;
            master.MasterName = masterName;
            master.MasterEname = masterEname;
            master.MasterStatus = NFMT.Common.StatusEnum.已录入;

            result = bll.Insert(user, master);

            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string masterName = context.Request.Form["mn"];
            string masterEname = context.Request.Form["men"];
            int masterStatus = 0;
            int masterId = 0;

            string resultStr = "添加失败";

            if (string.IsNullOrEmpty(masterName))
            {
                resultStr = "合约模板名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (string.IsNullOrEmpty(masterEname))
            {
                resultStr = "合约模板英文名称不能为空";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["ms"], out masterStatus) || masterStatus <= 0)
            {
                resultStr = "必须选择数据状态";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["mid"], out masterId) || masterId <= 0)
            {
                resultStr = "模板序号错误";
                context.Response.Write(resultStr);
                context.Response.End();
            }

            NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
            NFMT.Data.Model.ContractMaster master = new NFMT.Data.Model.ContractMaster();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            master.LastModifyId = user.EmpId;
            master.MasterName = masterName;
            master.MasterEname = masterEname;
            master.MasterId = masterId;
            master.MasterStatus = (NFMT.Common.StatusEnum)masterStatus;

            NFMT.Common.ResultModel result = bll.Update(user, master);
            resultStr = result.Message;

            context.Response.Write(resultStr);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int masterId = 0;
            int operateId = 0;

            if (!int.TryParse(context.Request.Form["mi"], out masterId) || masterId <= 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.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Data.BLL.ContractMasterBLL bll = new NFMT.Data.BLL.ContractMasterBLL();
            NFMT.Data.Model.ContractMaster master = new NFMT.Data.Model.ContractMaster();
            master.LastModifyId = user.EmpId;
            master.MasterId = masterId;

            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, master);
                    break;
                case NFMT.Common.OperateEnum.解除冻结:
                    result = bll.UnFreeze(user, master);
                    break;
            }

            context.Response.Write( result.Message);
        }