示例#1
0
 private void GetData(HttpContext context, string btn)
 {
     if (btn != "show")
     {
         context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
         return;
     }
     try
     {
         int roleId = RequestHelper.GetInt("id", 0);
         string roleStr = "";
         BLL.System.sys_Role bll = new BLL.System.sys_Role();
         if (roleId != 0)
         {
             DataTable dt = bll.GetList(roleId).Tables[0];
             if (dt.Rows.Count == 0)
             {
                 context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,该条数据已被其他人删除!\"}");
                 return;
             }
             roleStr = Utils.ToJson(dt);
         }
         Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
         StringBuilder strWhere = new StringBuilder();
         if (!loginUserModel.IsAdmin)
         {
             strWhere.Append(" and MenuType<>'system'");
         }
         BLL.System.sys_Menu menuBll = new BLL.System.sys_Menu();
         DataTable menuDT = menuBll.GetList(strWhere.ToString()).Tables[0];
         DataTable powerDT = bll.GetRolePowerAllList(roleId).Tables[0];
         string menuStr = DtToRolePowerJson(menuDT, powerDT, 0);
         menuStr = "[" + menuStr.Substring(1) + "]";
         StringBuilder jsonStr = new StringBuilder();
         if (roleId != 0)
         {
             jsonStr.Append("{\"status\":\"1\",\"msg\":\"数据获取成功!\",\"roleInfo\":" + roleStr + ",\"menuInfo\":" + menuStr + "}");
         }
         else
         {
             jsonStr.Append("{\"status\":\"1\",\"msg\":\"数据获取成功!\",\"roleInfo\":\"\",\"menuInfo\":" + menuStr + "}");
         }
         context.Response.Write(jsonStr);
     }
     catch (Exception e)
     {
         context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" +Utils.HtmlEncode(e.Message) + "\"}");
         return;
     }
 }
示例#2
0
        private void SaveData_All(HttpContext context, string btn)
        {
            if (btn != "btnSave")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string ScheduleStr             = RequestHelper.GetString("ScheduleStr");
            string ScheduleType            = RequestHelper.GetString("ScheduleType");
            string ScheduleDate            = RequestHelper.GetString("ScheduleDate");
            string AttachmentList_Schedule = RequestHelper.GetString("AttachmentId_Schedule");
            string Memo        = RequestHelper.GetString("Memo").Trim();
            string ScheduleId  = RequestHelper.GetString("ScheduleId");
            string PauseReason = RequestHelper.GetString("PauseReason");

            Model.System.sys_LoginUser        loginUserModel = BaseWeb.GetLoginInfo();
            SCZM.Model.Repair.repair_Schedule model          = new SCZM.Model.Repair.repair_Schedule();
            string[] modelList = ScheduleStr.Split(',');
            for (int i = 0; i < modelList.Length; i++)
            {
                model = new Model.Repair.repair_Schedule();
                string[] modelPart = modelList[i].Split('⊥');
                model.AssignmentId          = Utils.StrToInt(modelPart[0].ToString(), 0);
                model.AssignmentProcedureId = Utils.StrToInt(modelPart[1].ToString(), 0);
                model.ProcedureId           = Utils.StrToInt(modelPart[2].ToString(), 0);

                model.ScheduleType = Utils.StrToInt(ScheduleType, 0);
                if (Memo != "" && Utils.IsSafeSqlString(Memo))
                {
                    model.Memo = Utils.Filter(Memo);
                }
                if (ScheduleDate != "")
                {
                    model.ScheduleDate = Utils.StrToDateTime(ScheduleDate);
                }
                if (AttachmentList_Schedule != "")
                {
                    model.AttachmentList_Schedule = AttachmentList_Schedule;
                }
                model.OperaDepId  = loginUserModel.DepId;
                model.OperaId     = loginUserModel.ID;
                model.OperaName   = loginUserModel.PerName;
                model.OperaTime   = DateTime.Now;
                model.ID          = Utils.StrToInt(ScheduleId, -1);
                model.PauseReason = Utils.StrToInt(PauseReason, -1);
                SaveData(model, context);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            string btn   = RequestHelper.GetQueryString("Btn");
            string error = BaseWeb.CheckUserBtnPower();

            if (error != "")
            {
                context.Response.Write(error);
                return;
            }
            //取得处事类型
            string action = RequestHelper.GetQueryString("action");

            switch (action)
            {
            case "GetList":     //获取发件箱邮件列表



                GetList(context, btn);
                break;

            case "GetReceiveList":     //获取收件箱邮件列表



                GetReceiveList(context, btn);
                break;

            case "GetData":     //获取邮件信息
                GetData(context, btn);
                break;

            case "SaveData":     //保存邮件信息
                SaveData(context, btn);
                break;

            case "DelData":     //删除邮件信息
                DelData(context, btn);
                break;

            case "DelReceiveData":    //删除收件箱邮件列表

                DelReceiveData(context, btn);
                break;
            }
        }
        private void DelData(HttpContext context, string btn)
        {
            if (btn != "btnDel")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }



            BLL.System.sys_Attachment bll = new BLL.System.sys_Attachment();

            Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
            //string status = "0";
            string operaAction = "";
            string operaMemo   = "";

            try
            {
                UpLoad    upFiles = new UpLoad();
                DataTable dt      = bll.GetList("Source=1 and UseId=0").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        upFiles.fileDel(dt.Rows[i]["FilePath"].ToString());
                    }
                }
                bll.Delete("Source=1 and UseId=0");

                //status = "1";
                operaAction = Enums.ActionEnum.Delete.ToString();
                operaMemo   = "清理上传文件";

                //写入操作日志
                BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);

                context.Response.Write("{\"status\":\"1\",\"msg\":\"清理成功!\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#5
0
        /// <summary>
        /// 模版消息发送
        /// </summary>
        /// <param name="pData"></param>
        public void SenMsg(string postUrl, string pData)
        {
            BaseWeb bw           = new BaseWeb();
            string  access_token = Tools.getDbtoken();
            string  url          = postUrl + access_token;
            var     result       = bw.WXWebRequest(url, pData);
            var     msg          = JsonHelper.GetJsonValByKey(result, "errmsg");

            Log.WriteLog("msg", "wxtemp", msg);
            if (msg == "ok")
            {
                ToCustomerJson("0", "success");
            }
            else
            {
                ToCustomerJson("1", result);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            string btn   = RequestHelper.GetQueryString("Btn");
            string error = BaseWeb.CheckUserBtnPower();

            if (error != "")
            {
                context.Response.Write(error);
                return;
            }
            //取得处事类型
            string action = RequestHelper.GetQueryString("action");

            switch (action)
            {
            case "GetList":     //获取公告列表
                GetList(context, btn);
                break;

            case "GetListByPower":     //获取公告列表 根据个人权限
                GetListByPower(context, btn);
                break;

            case "GetData":     //获取公告信息
                GetData(context, btn);
                break;

            case "SaveData":     //保存公告信息
                SaveData(context, btn);
                break;

            case "DelData":     //删除公告信息
                DelData(context, btn);
                break;

            case "Submit":     //发布公告信息
                Submit(context, btn);
                break;

            case "SetTop":     //置顶公告信息
                SetTop(context, btn);
                break;
            }
        }
        public void ImportData(HttpContext context, string btn)
        {
            if (btn != "btnSave")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string rows = RequestHelper.GetString("rows");


            Model.System.sys_LoginUser             loginUserModel = BaseWeb.GetLoginInfo();
            SCZM.BLL.Base.base_CustomerInformation bll            = new SCZM.BLL.Base.base_CustomerInformation();

            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (rows != "")
                {
                    if (bll.ImportData(rows, out operaMessage) > 0)
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Add.ToString();
                        operaMemo   = "导入客户档案";
                    }
                }
                if (status == "1")
                {
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#8
0
        private void GetPersonCombo(HttpContext context, string btn)
        {
            string emptyStr = "[{\"PerId\":\"0\",\"PerName\":\"无\",\"DepName\":\"无\",\"DepId\":\"0\"}]";

            if (btn != "show")
            {
                context.Response.Write(emptyStr);
                return;
            }
            try
            {
                BLL.System.sys_Person bll = new BLL.System.sys_Person();
                string        DepId       = RequestHelper.GetString("DepId");
                string        PostId      = RequestHelper.GetString("PostId");
                string        FlagCtrl    = RequestHelper.GetString("FlagCtrl");
                string        PerName     = RequestHelper.GetString("q").Trim();
                StringBuilder strWhere    = new StringBuilder();
                if (DepId != "")
                {
                    strWhere.Append(" and a.DepId in(select ID from sys_Department where ','+SupList like '%," + DepId + ",%' or ID=" + DepId + ")");
                }
                if (PostId != "")
                {
                    strWhere.Append(" and a.PostId in(" + PostId + ")");
                }
                if (FlagCtrl == "1")
                {
                    Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
                    strWhere.Append(" and a.ID in(select CtrlPerId from v_sys_PersonCtrl where PerId=" + loginUserModel.ID.ToString() + ")");
                }
                if (PerName != "")
                {
                    strWhere.Append(" and a.PerName like '%" + PerName + "%' ");
                }
                DataTable dt      = bll.GetComboList(strWhere.ToString()).Tables[0];
                string    rowsStr = Utils.ToJson(dt);
                context.Response.Write(rowsStr);
            }
            catch
            {
                context.Response.Write(emptyStr);
            }
        }
示例#9
0
        private void GetHomePage(HttpContext context)
        {
            try
            {
                string loginSalt = RequestHelper.GetQueryString("LoginSalt");
                Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
                if (loginUserModel == null || loginUserModel.Salt != loginSalt)
                {
                    context.Response.Write("{\"status\":\"0.1\",\"msg\":\"对不起,登录超时,请重新登录!\"}");
                    return;
                }
                string vt = new BLL.System.sys_Config().loadConfig().webversiontime;
                BLL.System.sys_Mail_Send mailBll = new BLL.System.sys_Mail_Send();
                int receiveNoRead = mailBll.GetReceiveNoRead(loginUserModel.ID);


                BLL.sys_Bulletin bll        = new BLL.sys_Bulletin();
                int       recordNumBulletin = RequestHelper.GetInt("recordNumBulletin", 0);
                string    strWhere          = "";
                DataTable bulletinDT        = bll.GetListByPower(strWhere, recordNumBulletin, loginUserModel.DepId).Tables[0];
                string    bulletinInfo      = Utils.ToJson(bulletinDT);

                BLL.System.sys_Menu menuBll = new BLL.System.sys_Menu();
                DataTable           todoDT  = menuBll.GetTodoList(loginUserModel.ID).Tables[0];
                string todoInfo             = Utils.ToJson(todoDT);

                DataTable nodoDT   = menuBll.GetNodoList(loginUserModel.ID).Tables[0];
                string    nodoInfo = Utils.ToJson(nodoDT);

                StringBuilder jsonStr = new StringBuilder();
                jsonStr.Append("{\"status\":\"1\",\"msg\":\"数据获取成功!\",\"vt\":\"" + vt + "\"");
                jsonStr.Append(",\"receiveNoRead\":" + receiveNoRead);
                jsonStr.Append(",\"bulletinInfo\":" + bulletinInfo);
                jsonStr.Append(",\"todoInfo\":" + todoInfo);
                jsonStr.Append(",\"nodoInfo\":" + nodoInfo);
                jsonStr.Append("}");
                context.Response.Write(jsonStr);
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"" + e.Message + "\"}");
            }
        }
示例#10
0
        private void ModifyPwd(HttpContext context)
        {
            try
            {
                string loginSalt = RequestHelper.GetQueryString("LoginSalt");
                if (loginSalt == "")
                {
                    context.Response.Write("{\"status\":\"0.1\",\"msg\":\"Salt不能为空!\"}");
                    return;
                }
                Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
                if (loginUserModel == null || loginUserModel.Salt != loginSalt)
                {
                    context.Response.Write("{\"status\":\"0.1\",\"msg\":\"登录超时,请重新登录!\"}");
                    return;
                }

                string oldPwd             = RequestHelper.GetString("oldPwd");
                string newPwd             = RequestHelper.GetString("newPwd");
                BLL.System.sys_Person bll = new BLL.System.sys_Person();


                string errMessage = bll.UpdatePwd(loginUserModel.Account, oldPwd, newPwd);
                if (errMessage != "")
                {
                    context.Response.Write("{\"status\":\"0\",\"msg\":\"" + errMessage + "\"}");
                    return;
                }
                //写入操作日志

                Model.System.sys_OperaLog operaModel = BaseWeb.GetOperaModel(loginUserModel);
                operaModel.OperaType = Enums.ActionEnum.Login.ToString();
                operaModel.Memo      = "修改密码";
                new BLL.System.sys_OperaLog().Add(operaModel);

                context.Response.Write("{\"status\":\"1\",\"msg\":\"密码修改成功!\"}");
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#11
0
        public void ProcessRequest(HttpContext context)
        {
            string btn   = RequestHelper.GetQueryString("Btn");
            string error = BaseWeb.CheckUserBtnPower();

            if (error != "")
            {
                context.Response.Write(error);
                return;
            }
            //取得处事类型
            string action = RequestHelper.GetQueryString("action");

            switch (action)
            {
            case "GetList":     //获取人员列表
                GetList(context, btn);
                break;

            case "GetData":     //获取人员信息
                GetData(context, btn);
                break;

            case "SaveData":     //保存人员信息
                SaveData(context, btn);
                break;

            case "DelData":     //删除人员信息
                DelData(context, btn);
                break;

            case "GetPwd":     //获取人员密码
                GetPwd(context, btn);
                break;

            case "InitPwd":     //初始化人员密码



                InitPwd(context, btn);
                break;
            }
        }
示例#12
0
        private void DelData(HttpContext context, string btn)
        {
            if (btn != "btnDel")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string idStr   = RequestHelper.GetString("idStr");
            string nameStr = RequestHelper.GetString("nameStr");

            if (idStr == "")
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"请选择需要删除的记录!\"}");
                return;
            }
            BLL.System.sys_Department bll = new BLL.System.sys_Department();

            Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (bll.DeleteList(PageValidate.SafeLongFilter(idStr, 0), out operaMessage))
                {
                    status      = "1";
                    operaAction = Enums.ActionEnum.Delete.ToString();
                    operaMemo   = "删除部门:" + nameStr + "(" + idStr + ")";
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#13
0
        public void ProcessRequest(HttpContext context)
        {
            string btn   = RequestHelper.GetQueryString("Btn");
            string error = BaseWeb.CheckUserBtnPower();

            if (error != "")
            {
                showError(context, "请重新登录!");
                return;
            }
            //取得处事类型
            string action = RequestHelper.GetQueryString("action");

            switch (action)
            {
            case "GetList":     //获取上传文件日志列表
                GetList(context, btn);
                break;

            case "DelData":     //删除上传文件日志信息
                DelData(context, btn);
                break;

            case "EditorFile":     //编辑器文件



                EditorFile(context);
                break;

            case "ManagerFile":     //管理文件
                ManagerFile(context);
                break;

            default:     //普通上传



                UpLoadFile(context);
                break;
            }
        }
        private void GetData(HttpContext context, string btn)
        {
            if (btn != "show")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            int perId = RequestHelper.GetInt("id", 0);

            if (perId == 0)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,人员ID不能为空!\"}");
                return;
            }
            try
            {
                BLL.System.sys_PersonPower bll = new BLL.System.sys_PersonPower();

                Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
                StringBuilder strWhere = new StringBuilder();
                if (!loginUserModel.IsAdmin)
                {
                    strWhere.Append(" and MenuType<>'system'");
                }
                BLL.System.sys_Menu menuBll = new BLL.System.sys_Menu();
                DataTable           menuDT  = menuBll.GetList(strWhere.ToString()).Tables[0];
                DataTable           powerDT = bll.GetPerPowerAllList(perId).Tables[0];
                string menuStr = DtToRolePowerJson(menuDT, powerDT, 0);
                menuStr = "[" + menuStr.Substring(1) + "]";
                StringBuilder jsonStr = new StringBuilder();

                jsonStr.Append("{\"status\":\"1\",\"msg\":\"数据获取成功!\",\"menuInfo\":" + menuStr + "}");

                context.Response.Write(jsonStr);
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
        private void SetTop(HttpContext context, string btn)
        {
            if (btn != "btnSetTop" && btn != "btnCancelSetTop")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string idStr   = RequestHelper.GetString("idStr");
            int    flagTop = RequestHelper.GetInt("flagTop", 0);

            if (idStr == "")
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"请选择需要操作的记录!\"}");
                return;
            }
            BLL.sys_Bulletin           bll            = new BLL.sys_Bulletin();
            Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (bll.SetTop(PageValidate.SafeLongFilter(idStr, 0), flagTop, loginUserModel.ID, loginUserModel.PerName, out operaMessage))
                {
                    status      = "1";
                    operaAction = Enums.ActionEnum.Delete.ToString();
                    operaMemo   = (flagTop == 0 ? "取消" : "") + "置顶公告:(" + idStr + ")";
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#16
0
        public void ProcessRequest(HttpContext context)
        {
            string btn   = RequestHelper.GetQueryString("Btn");
            string error = BaseWeb.CheckUserBtnPower();

            if (error != "")
            {
                context.Response.Write(error);
                return;
            }
            //取得处事类型
            string action = RequestHelper.GetQueryString("action");

            switch (action)
            {
            case "GetList":     //获取进度反馈列表
                GetList(context, btn);
                break;

            case "GetDetail":     //获取进度反馈明细
                GetDetail(context, btn);
                break;

            case "SaveData":     //保存进度反馈信息
                SaveData_All(context, btn);
                break;

            case "DelData":     //删除进度反馈信息
                DelData(context, btn);
                break;

            case "GetList_HaveAttachment":    //包含附件的反馈列表

                GetList_HaveAttachment(context, btn);
                break;

            case "DeleteLastSchedule":
                DeleteLastSchedule(context, btn);
                break;
            }
        }
示例#17
0
        private void ResponseInfo(HttpContext context, string remsg)
        {
            JsonData jd     = JsonMapper.ToObject(remsg);
            string   status = jd["status"].ToString();
            string   msg    = jd["msg"].ToString();

            if (status == "0")
            {
                showError(context, msg);
                return;
            }


            string filePath = jd["path"].ToString(); //取得上传后的路径
            string fileName = jd["name"].ToString(); //取得上传的文件名

            Model.System.sys_Attachment model          = new Model.System.sys_Attachment();
            Model.System.sys_LoginUser  loginUserModel = BaseWeb.GetLoginInfo();
            model.Source    = 1;
            model.FileName  = fileName;
            model.FilePath  = filePath;
            model.FileUse   = "";
            model.UseId     = 0;
            model.OperaName = loginUserModel.PerName;
            model.OperaTime = DateTime.Now;
            string operaMessage = "";

            BLL.System.sys_Attachment bll = new BLL.System.sys_Attachment();
            int fileId = bll.Add(model, out operaMessage);


            Hashtable hash = new Hashtable();

            hash["error"]    = 0;
            hash["url"]      = filePath;
            hash["fileName"] = fileName;
            hash["fileId"]   = fileId;
            context.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            context.Response.Write(JsonMapper.ToJson(hash));
            context.Response.End();
        }
示例#18
0
        private void DeleteLastSchedule(HttpContext context, string btn)
        {
            if (btn != "btnDel")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string ID = RequestHelper.GetString("ID");

            if (ID == "")
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"请选择需要删除的记录!\"}");
                return;
            }
            string prevId = RequestHelper.GetString("prevId");

            Model.System.sys_LoginUser      loginUserModel = BaseWeb.GetLoginInfo();
            SCZM.BLL.Repair.repair_Schedule bll            = new SCZM.BLL.Repair.repair_Schedule();
            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (bll.DeleteLastSchedule(Utils.StrToInt(ID, 0), Utils.StrToInt(prevId, 0), out operaMessage))
                {
                    status      = "1";
                    operaAction = Enums.ActionEnum.Delete.ToString();
                    operaMemo   = "删除进度反馈:" + ID;
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
            }
        }
示例#19
0
        public void ProcessRequest(HttpContext context)
        {
            string btn   = RequestHelper.GetQueryString("Btn");
            string error = BaseWeb.CheckUserBtnPower();

            if (error != "")
            {
                context.Response.Write(error);
                return;
            }
            //取得处事类型
            string action = RequestHelper.GetQueryString("action");

            switch (action)
            {
            case "GetList":     //获取维修派工列表
                GetList(context, btn);
                break;

            case "GetDetail":     //获取维修派工明细
                GetDetail(context, btn);
                break;

            case "SaveData":     //保存维修派工信息
                SaveData(context, btn);
                break;

            case "DelData":     //删除维修派工信息
                DelData(context, btn);
                break;

            case "GetScheduleList":
                GetScheduleList(context, btn);
                break;

            case "UndoData":
                UndoData(context, btn);
                break;
            }
        }
示例#20
0
        private void GetMenu(HttpContext context)
        {
            try
            {
                string loginSalt = RequestHelper.GetQueryString("LoginSalt");
                if (loginSalt == "")
                {
                    context.Response.Write("身份验证失败");
                    return;
                }
                Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();
                if (loginUserModel == null || loginUserModel.Salt != loginSalt)
                {
                    //context.Response.Write("{\"status\":\"0\",\"msg\":\"身份验证失败!\"}");
                    context.Response.Write("身份验证失败");
                    return;
                }

                string    htmlStr = "";
                DataTable dt      = null;
                if (loginUserModel.IsAdmin == true)
                {
                    dt = new BLL.System.sys_Menu().GetList("").Tables[0];
                }
                else
                {
                    dt = new BLL.System.sys_Person().GetUserMenu(loginUserModel.ID).Tables[0];
                }
                DataTable btnDT       = new BLL.System.sys_Menu().GetNoPowerBtn(loginUserModel.ID).Tables[0];
                int       levelOpenId = dt.Select("levelId=1").Length > 4 ? 1 : 2;
                htmlStr = AddNode(dt, btnDT, 1, levelOpenId, "0", "ID", "menuName", "supId", "sortId", "linkUrl", "levelId");
                context.Response.Write(htmlStr);
            }
            catch
            {
                context.Response.Write("身份验证失败");
                return;
            }
        }
示例#21
0
        private void UndoData(HttpContext context, string btn)
        {
            if (btn != "btnUndo")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string IDStr = RequestHelper.GetString("IDStr");

            if (IDStr == "")
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"请选择需要作废的记录!\"}");
                return;
            }
            Model.System.sys_LoginUser        loginUserModel = BaseWeb.GetLoginInfo();
            SCZM.BLL.Repair.Repair_Assignment bll            = new SCZM.BLL.Repair.Repair_Assignment();
            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (bll.UndoList(PageValidate.SafeLongFilter(IDStr, 0), out operaMessage))
                {
                    status      = "1";
                    operaAction = Enums.ActionEnum.Delete.ToString();
                    operaMemo   = "作废维修派工:" + IDStr;
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
            }
        }
示例#22
0
        private void InitPwd(HttpContext context, string btn)
        {
            if (btn != "btnInitPwd")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            try
            {
                int perId = RequestHelper.GetInt("id", 0);
                Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();

                string operaAction = "";
                string operaMemo   = "";

                BLL.System.sys_Person bll = new BLL.System.sys_Person();
                string pwd = bll.InitPwd(perId);
                if (pwd == "")
                {
                    context.Response.Write("{\"status\":\"1\",\"msg\":\"初始化密码失败!\"}");
                    return;
                }
                else
                {
                    operaAction = Enums.ActionEnum.Edit.ToString();
                    operaMemo   = "初始化密码:(" + perId + ")";
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"1\",\"msg\":\"初始化成功,密码为" + pwd + "!\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            string btn   = RequestHelper.GetQueryString("Btn");
            string error = BaseWeb.CheckUserBtnPower();

            if (error != "")
            {
                context.Response.Write(error);
                return;
            }
            //取得处事类型
            string action = RequestHelper.GetQueryString("action");

            switch (action)
            {
            case "GetList":     //获取模块配置列表
                GetList(context, btn);
                break;

            case "GetData":     //获取模块配置信息
                GetData(context, btn);
                break;

            case "SaveData":     //保存模块配置信息
                SaveData(context, btn);
                break;

            case "DelData":     //删除模块配置信息
                DelData(context, btn);
                break;

            case "GetBillProcess":    //获取单据的审批流信息
                GetBillProcess(context, btn);
                break;
            }
        }
        private void GetList(HttpContext context, string btn)
        {
            if (btn != "show")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            try
            {
                string IntentionCode = RequestHelper.GetString("IntentionCode").Trim();

                string CustTypeId        = RequestHelper.GetString("CustTypeId").Trim();
                string CustName          = RequestHelper.GetString("CustName").Trim();
                string MachineModel      = RequestHelper.GetString("MachineModel").Trim();
                string MachineCode       = RequestHelper.GetString("MachineCode").Trim();
                string PayType           = RequestHelper.GetString("PayType").Trim();
                string ReceiveDate_Start = RequestHelper.GetString("ReceiveDate_Start").Trim();
                string ReceiveDate_End   = RequestHelper.GetString("ReceiveDate_End").Trim();

                StringBuilder strWhere = new StringBuilder();

                //--------------------------------------------------------------
                Model.System.sys_LoginUser LoginUserModel = BaseWeb.GetLoginInfo();
                if (LoginUserModel.IsAdmin == false)
                {
                    strWhere.Append(" and a.OperaId in (select CtrlPerId from v_sys_PersonCtrl where PerId=" + LoginUserModel.ID + ") ");
                }
                //-------------------------------------------------------------------------

                //维修意向号

                if (IntentionCode != "" && Utils.IsSafeSqlString(IntentionCode))
                {
                    strWhere.Append(" and b.IntentionCode like '%" + Utils.Filter(IntentionCode) + "%'");
                }


                //客户类型
                if (CustTypeId != "")
                {
                    strWhere.Append(" and b.CustTypeId=" + Utils.StrToInt(CustTypeId, 0));
                }
                //客户名

                if (CustName != "" && Utils.IsSafeSqlString(CustName))
                {
                    strWhere.Append(" and b.CustName like '%" + Utils.Filter(CustName) + "%'");
                }
                //机型
                if (MachineModel != "")
                {
                    strWhere.Append(" and c.MachineModel LIKE '%" + Utils.Filter(MachineModel) + "%' ");
                }
                //机号
                if (MachineCode != "")
                {
                    strWhere.Append(" and b.MachineCode like '%" + Utils.Filter(MachineCode) + "%'");
                }
                //付款方式
                if (PayType != "")
                {
                    strWhere.Append(" and a.PayType=" + Utils.StrToInt(PayType, 0));
                }
                //收款时间
                if (ReceiveDate_Start != "")
                {
                    strWhere.Append(" and a.ReceiveDate>=cast('" + Utils.StrToDateTime(ReceiveDate_Start).ToString() + "' as datetime)");
                }
                if (ReceiveDate_End != "")
                {
                    strWhere.Append(" and a.ReceiveDate<=cast('" + Utils.StrToDateTime(ReceiveDate_End + " 23:59:59").ToString() + "' as datetime) ");
                }
                SCZM.BLL.Repair.repair_ReceiveFee bll = new SCZM.BLL.Repair.repair_ReceiveFee();
                DataTable     dt      = bll.GetList(strWhere.ToString()).Tables[0];
                string        rowsStr = Utils.ToJson(dt);
                StringBuilder jsonStr = new StringBuilder();
                jsonStr.Append("{\"status\":\"1\",\"msg\":\"数据获取成功!\",\"info\":" + rowsStr + "}");
                context.Response.Write(jsonStr);
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
            }
        }
示例#25
0
        private void SaveData(HttpContext context, string btn)
        {
            if (btn != "btnSave")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string id      = RequestHelper.GetString("id");
            string supId   = RequestHelper.GetString("supId");
            string depName = RequestHelper.GetString("depName");
            string depType = RequestHelper.GetString("depType");
            string QDCode  = RequestHelper.GetString("QDCode");
            string depTel  = RequestHelper.GetString("depTel");
            string sortId  = RequestHelper.GetString("sortId");
            string flagUse = RequestHelper.GetString("flagUse");

            //string ctrlDep = RequestHelper.GetString("ctrlDep");
            if (supId == "")
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"上级部门编码不能为空!\"}");
                return;
            }
            if (depName == "")
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"部门名称不能为空!\"}");
                return;
            }
            Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();

            BLL.System.sys_Department   bll   = new BLL.System.sys_Department();
            Model.System.sys_Department model = new Model.System.sys_Department();

            model.ID        = Utils.StrToInt(id, 0);
            model.DepName   = depName;
            model.DepTel    = depTel;
            model.DepTypeId = Utils.StrToInt(depType, 1);
            model.QDCode    = QDCode;
            model.SortId    = Utils.StrToInt(sortId, 1);
            model.SupId     = Utils.StrToInt(supId, 1);
            model.FlagUse   = Utils.StrToBool(flagUse, true);
            model.OperaName = loginUserModel.PerName;
            model.OperaTime = DateTime.Now;

            DataTable dt = bll.GetList(int.Parse(supId)).Tables[0];

            model.SupList = dt.Rows[0]["SupList"].ToString() + model.SupId + ",";
            model.LevelId = Utils.ObjToInt(dt.Rows[0]["levelId"], 1) + 1;

            //List<Model.System.sys_DepartmentCtrl> ctrlModelList=new List<Model.System.sys_DepartmentCtrl> ();
            //Model.System.sys_DepartmentCtrl ctrlModel = new Model.System.sys_DepartmentCtrl();
            //string[] ctrlDepIdArray = ctrlDep.Split(',');

            //string[] ctrlDepIdArrayNew= ctrlDepIdArray.Intersect(ctrlDepIdArray).ToArray();

            //int ctrlDepId = 0;
            //foreach (string s in ctrlDepIdArrayNew)
            //{
            //    ctrlDepId = Utils.StrToInt(s, 0);
            //    if (ctrlDepId != 0)
            //    {

            //        ctrlModel = new Model.System.sys_DepartmentCtrl();
            //        ctrlModel.CtrlDepId = ctrlDepId;
            //        ctrlModelList.Add(ctrlModel);
            //    }
            //}
            //model.sys_DepartmentCtrls = ctrlModelList;

            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (id == "")
                {
                    model.ID = bll.Add(model, out operaMessage);
                    if (model.ID > 0)
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Add.ToString();
                        operaMemo   = "新增部门:" + model.DepName + "(" + model.ID + ")";
                        //写入操作日志
                        BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                    }
                }
                else
                {
                    if (bll.Update(model, out operaMessage))
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Edit.ToString();
                        operaMemo   = "修改部门:" + model.DepName + "(" + model.ID + ")";
                        //写入操作日志
                        BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                    }
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#26
0
        private void SaveData(HttpContext context, string btn)
        {
            if (btn != "btnSave")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string id          = RequestHelper.GetString("id");
            string processName = RequestHelper.GetString("processName");
            string flagUse     = RequestHelper.GetString("flagUse");
            string memo        = RequestHelper.GetString("memo");
            string post        = RequestHelper.GetString("post");

            if (processName == "")
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"审批流名称不能为空!\"}");
                return;
            }
            Model.System.sys_LoginUser loginUserModel = BaseWeb.GetLoginInfo();

            BLL.System.sys_Process   bll   = new BLL.System.sys_Process();
            Model.System.sys_Process model = new Model.System.sys_Process();

            model.ID          = Utils.StrToInt(id, 0);
            model.ProcessName = processName;
            model.FlagUse     = Utils.StrToBool(flagUse, true);
            model.Memo        = memo;
            model.OperaName   = loginUserModel.PerName;
            model.OperaTime   = DateTime.Now;


            List <Model.System.sys_ProcessDetail> detailModelList = new List <Model.System.sys_ProcessDetail>();

            Model.System.sys_ProcessDetail detailModel = new Model.System.sys_ProcessDetail();
            string[] postArray = post.Split(',');
            int      postId    = 0;
            int      i         = 0;

            foreach (string s in postArray)
            {
                postId = Utils.StrToInt(s, 0);
                if (postId != 0)
                {
                    i++;
                    detailModel         = new Model.System.sys_ProcessDetail();
                    detailModel.OrderId = i;
                    detailModel.PostId  = postId;
                    detailModelList.Add(detailModel);
                }
            }
            model.sys_ProcessDetails = detailModelList;

            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (id == "")
                {
                    model.ID = bll.Add(model, out operaMessage);
                    if (model.ID > 0)
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Add.ToString();
                        operaMemo   = "新增审批流:" + model.ProcessName + "(" + model.ID + ")";
                        //写入操作日志
                        BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                    }
                }
                else
                {
                    if (bll.Update(model, out operaMessage))
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Edit.ToString();
                        operaMemo   = "修改审批流:" + model.ProcessName + "(" + model.ID + ")";
                        //写入操作日志
                        BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                    }
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#27
0
        private void Login(HttpContext context)
        {
            try
            {
                string account = RequestHelper.GetString("account");
                string pwd     = RequestHelper.GetString("pwd");
                string url     = RequestHelper.GetUrlReferrer();

                //判断登录错误次数
                if (context.Session["LoginNum"] != null && Convert.ToInt32(context.Session["LoginNum"]) > 5)
                {
                    context.Response.Write("{\"status\":\"0\",\"msg\":\"错误超过5次,关闭浏览器重新登录!\"}");
                    return;
                }
                if (account.Trim() == "")
                {
                    WriteError(context);
                    context.Response.Write("{\"status\":\"0\",\"msg\":\"账号不能为空!\"}");
                    return;
                }
                if (pwd.Trim() == "")
                {
                    WriteError(context);
                    context.Response.Write("{\"status\":\"0\",\"msg\":\"密码不能为空!\"}");
                    return;
                }
                if (url.Trim() == "")
                {
                    WriteError(context);
                    context.Response.Write("{\"status\":\"0.1\",\"msg\":\"非法传入页面!\"}");
                    return;
                }
                String domain = Utils.GetUrlDomain(url).ToLower();
                if (domain != "localhost" || RequestHelper.GetIP() != "127.0.0.1")
                {
                    Model.System.sys_Config configModel = new BLL.System.sys_Config().loadConfig();
                    string[] domainArray = (configModel.webinsideurl + "," + configModel.weburl).Split(',');
                    if (domain == "" || !domainArray.Contains(domain))
                    {
                        WriteError(context);
                        context.Response.Write("{\"status\":\"0.1\",\"msg\":\"非法传入页面!\"}");
                        return;
                    }
                }
                BLL.System.sys_Person      bll   = new BLL.System.sys_Person();
                Model.System.sys_LoginUser model = bll.GetModel(account, pwd, true);
                if (model == null)
                {
                    WriteError(context);
                    context.Response.Write("{\"status\":\"0\",\"msg\":\"用户名或密码有误,请重试!\"}");
                    return;
                }
                model.Salt      = Utils.GetLetterOrNumberRandom(10);
                model.LoginTime = DateTime.Now;
                model.LoginIP   = RequestHelper.GetIP();
                // 保存登录人的Sessin
                context.Session[Keys.SESSION_LoginUser] = model;
                context.Session.Timeout = 45;
                //写入登录日志
                string operaAction = Enums.ActionEnum.Login.ToString();
                string operaMemo   = "用户登录";
                BaseWeb.AddOpera(model, 0, operaAction, operaMemo);


                context.Response.Write("{\"status\":\"1\",\"msg\":\"权限获取成功!\",\"userName\":\"" + model.PerName + "\",\"loginSalt\":\"" + model.Salt + "\"}");
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"" + e.Message + "\"}");
            }
        }
示例#28
0
        private void SaveData(HttpContext context, string btn)
        {
            if (btn != "btnSave")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string ID             = RequestHelper.GetString("ID");
            string ProcedureId    = RequestHelper.GetString("ProcedureId");
            string MachineLevel10 = RequestHelper.GetString("MachineLevel10");
            string MachineLevel20 = RequestHelper.GetString("MachineLevel20");
            string MachineLevel30 = RequestHelper.GetString("MachineLevel30");
            string MachineLevel40 = RequestHelper.GetString("MachineLevel40");
            string MachineLevel50 = RequestHelper.GetString("MachineLevel50");
            string NumType        = RequestHelper.GetString("NumType");

            Model.System.sys_LoginUser loginUserModel      = BaseWeb.GetLoginInfo();
            SCZM.Model.Base.base_ProcedureMachineNat model = new SCZM.Model.Base.base_ProcedureMachineNat();
            SCZM.BLL.Base.base_ProcedureMachineNat   bll   = new SCZM.BLL.Base.base_ProcedureMachineNat();
            model.ID             = Utils.StrToInt(ID, 0);
            model.ProcedureId    = Utils.StrToInt(ProcedureId, 0);
            model.MachineLevel10 = Utils.StrToDecimal(MachineLevel10, 0);
            model.MachineLevel20 = Utils.StrToDecimal(MachineLevel20, 0);
            model.MachineLevel30 = Utils.StrToDecimal(MachineLevel30, 0);
            model.MachineLevel40 = Utils.StrToDecimal(MachineLevel40, 0);
            model.MachineLevel50 = Utils.StrToDecimal(MachineLevel50, 0);
            model.NumType        = Utils.StrToInt(NumType, 0);
            model.OperaId        = loginUserModel.ID;
            model.OperaName      = loginUserModel.PerName;
            model.OperaTime      = DateTime.Now;

            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (ID == "")
                {
                    model.ID = bll.Add(model, out operaMessage);
                    if (model.ID > 0)
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Add.ToString();
                        operaMemo   = "新增奖励核算:" + model.ID;
                    }
                }
                else
                {
                    if (bll.Update(model, out operaMessage))
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Edit.ToString();
                        operaMemo   = "修改奖励核算:" + model.ID;
                    }
                }
                if (status == "1")
                {
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
        private void SaveData(HttpContext context, string btn)
        {
            if (btn != "btnSave")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string ID          = RequestHelper.GetString("ID");
            string IntentionId = RequestHelper.GetString("IntentionId");
            string PayType     = RequestHelper.GetString("PayType");
            string ReceiveFee  = RequestHelper.GetString("ReceiveFee");
            string ReceiveDate = RequestHelper.GetString("ReceiveDate");


            Model.System.sys_LoginUser          loginUserModel = BaseWeb.GetLoginInfo();
            SCZM.Model.Repair.repair_ReceiveFee model          = new SCZM.Model.Repair.repair_ReceiveFee();
            SCZM.BLL.Repair.repair_ReceiveFee   bll            = new SCZM.BLL.Repair.repair_ReceiveFee();
            model.ID          = Utils.StrToInt(ID, 0);
            model.IntentionId = Utils.StrToInt(IntentionId, 0);
            model.PayType     = Utils.StrToInt(PayType, 0);
            model.ReceiveFee  = Utils.StrToDecimal(ReceiveFee, 0);
            if (ReceiveDate != "")
            {
                model.ReceiveDate = Utils.StrToDateTime(ReceiveDate);
            }
            model.OperaDepId = loginUserModel.DepId;
            model.OperaId    = loginUserModel.ID;
            model.OperaName  = loginUserModel.PerName;
            model.OperaTime  = DateTime.Now;

            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (ID == "")
                {
                    model.ID = bll.Add(model, out operaMessage);
                    if (model.ID > 0)
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Add.ToString();
                        operaMemo   = "新增收款确认:" + model.ID;
                    }
                }
                else
                {
                    if (bll.Update(model, out operaMessage))
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Edit.ToString();
                        operaMemo   = "修改收款确认:" + model.ID;
                    }
                }
                if (status == "1")
                {
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }
示例#30
0
        private void SaveData(HttpContext context, string btn)
        {
            if (btn != "btnSave")
            {
                context.Response.Write("{\"status\":\"0.2\",\"msg\":\"对不起,您没有操作权限!\"}");
                return;
            }
            string ID                    = RequestHelper.GetString("ID");
            string IntentionId           = RequestHelper.GetString("IntentionId");
            string GetAccessoriesDate    = RequestHelper.GetString("GetAccessoriesDate");
            string UserName              = RequestHelper.GetString("UserName");
            string AllFee                = RequestHelper.GetString("AllFee");
            string AllFee_actual         = RequestHelper.GetString("AllFee_actual");
            string Memo                  = RequestHelper.GetString("Memo");
            string detailStr_Accessories = RequestHelper.GetString("detailStr_Accessories");
            string BillType              = RequestHelper.GetString("BillType");

            Model.System.sys_LoginUser loginUserModel      = BaseWeb.GetLoginInfo();
            SCZM.Model.Repair.repair_AccessoriesBill model = new SCZM.Model.Repair.repair_AccessoriesBill();
            SCZM.BLL.Repair.repair_AccessoriesBill   bll   = new SCZM.BLL.Repair.repair_AccessoriesBill();
            model.ID          = Utils.StrToInt(ID, 0);
            model.IntentionId = Utils.StrToInt(IntentionId, 0);
            if (GetAccessoriesDate != "")
            {
                model.GetAccessoriesDate = Utils.StrToDateTime(GetAccessoriesDate);
            }
            model.UserName      = UserName;
            model.AllFee        = Utils.StrToDecimal(AllFee, 0);
            model.AllFee_actual = Utils.StrToDecimal(AllFee_actual, 0);
            model.BillType      = Utils.StrToInt(BillType, 0);
            model.Memo          = Memo;
            model.OperaDepId    = loginUserModel.DepId;
            model.OperaId       = loginUserModel.ID;
            model.OperaName     = loginUserModel.PerName;
            model.OperaTime     = DateTime.Now;

            List <Model.Repair.repair_AccessoriesBill_Accessories> model_detail = new List <Model.Repair.repair_AccessoriesBill_Accessories>();

            Model.Repair.repair_AccessoriesBill_Accessories models = new Model.Repair.repair_AccessoriesBill_Accessories();
            if (detailStr_Accessories != "")
            {
                string[] detailRow = detailStr_Accessories.Split('≮');
                for (int i = 0; i < detailRow.Length; i++)
                {
                    string[] detailCell = detailRow[i].Split('⊥');
                    models = new Model.Repair.repair_AccessoriesBill_Accessories();
                    models.AccessoriesId   = Utils.StrToInt(detailCell[0], 0);
                    models.AccessoriesNat  = Utils.StrToInt(detailCell[1], 0);
                    models.AccessoriesNum  = Utils.StrToInt(detailCell[2], 0);
                    models.AccessoriesFee  = Utils.StrToInt(detailCell[3], 0);
                    models.AccessoriesMemo = detailCell[4];
                    models.AccessoriesDate = Utils.StrToDateTime(detailCell[5], DateTime.Now);
                    model_detail.Add(models);
                }
                model.repair_AccessoriesBill_Accessoriess = model_detail;
            }

            string operaMessage = "";
            string status       = "0";
            string operaAction  = "";
            string operaMemo    = "";

            try
            {
                if (ID == "")
                {
                    model.ID = bll.Add(model, out operaMessage);
                    if (model.ID > 0)
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Add.ToString();
                        operaMemo   = "新增辅料明细:" + model.ID;
                    }
                }
                else
                {
                    if (bll.Update(model, out operaMessage))
                    {
                        status      = "1";
                        operaAction = Enums.ActionEnum.Edit.ToString();
                        operaMemo   = "修改辅料明细:" + model.ID;
                    }
                }
                if (status == "1")
                {
                    //写入操作日志
                    BaseWeb.AddOpera(loginUserModel, int.Parse(RequestHelper.GetQueryString("MenuId")), operaAction, operaMemo);
                }
                context.Response.Write("{\"status\":\"" + status + "\",\"msg\":\"" + operaMessage + "\"}");
                return;
            }
            catch (Exception e)
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"对不起,系统出错:" + Utils.HtmlEncode(e.Message) + "\"}");
                return;
            }
        }