public void ProcessRequest(HttpContext context) { try { // BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); if (UserRightsService.CheckLoginUserIDByCookies(LoginCookiesContent) > 0) { MagezineInfoImportHelper helper = new MagezineInfoImportHelper(); switch (helper.Action) { case "batchimport": string msg = ""; AJAXHelper.WrapJsonResponse(helper.BatchImport(out msg), "", msg); break; default: AJAXHelper.WrapJsonResponse(false, "", "没有对应的操作"); break; } } } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "", ex.Message); } }
public void ProcessRequest(HttpContext context) { try { string msg = ""; // BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); if (UserRightsService.CheckLoginUserIDByCookies(LoginCookiesContent) > 0) { CustInfoImportHelper helper = new CustInfoImportHelper(); BLL.Loger.Log4Net.Info("1:" + helper.Action); switch (helper.Action) { case "batchimport": string tipinfo = ""; AJAXHelper.WrapJsonResponse(helper.BatchImport(out msg, out tipinfo), tipinfo, msg); break; default: AJAXHelper.WrapJsonResponse(false, "", "没有对应的操作"); break; } } } catch (Exception ex) { BLL.Loger.Log4Net.Info("导入数据出错:---" + ex.Message + ";堆栈:" + ex.StackTrace + ";全:" + ex); AJAXHelper.WrapJsonResponse(false, "", ex.Message); } }
public void ProcessRequest(HttpContext context) { try { BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); bool success = true; string result = ""; string msg = ""; switch (Action) { case "established": //呼出接通 msg = UserEvent; break; case "released": //挂断 msg = UserEvent; break; case "ringing": //振铃 msg = UserEvent; break; default: success = false; msg = "请求参数错误"; break; } AJAXHelper.WrapJsonResponse(success, result, msg); } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "", ex.Message); } }
public void ProcessRequest(HttpContext context) { //BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); System.Diagnostics.Debug.WriteLine("[Handler]ProcessRequest begin..."); context.Response.ContentType = "text/plain"; try { if (UserRightsService.CheckLoginUserIDByCookies(LoginCookiesContent) > 0) { switch (Action) { case "batchimport": string msg = ""; //AJAXHelper.WrapJsonResponse(BatchImport(out msg), "", msg); BatchImport(out msg); context.Response.Write(msg); break; default: AJAXHelper.WrapJsonResponse(false, "", "没有对应的操作"); break; } } } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "", ex.Message); } }
public void ProcessRequest(HttpContext context) { try { BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); bool success = true; string result = ""; string msg = ""; switch (helper.Action) { case "deleteccmember": helper.DeleteCCMember(); break; case "deletecccstmember": helper.DeleteCCCstMember(); break; default: success = false; msg = "请求参数错误"; break; } AJAXHelper.WrapJsonResponse(success, result, msg); } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "", ex.Message); } }
public void ProcessRequest(HttpContext context) { try { BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); bool success = true; string result = ""; string msg = ""; switch (helper.Action.ToLower().Trim()) { case "addcontact": helper.AddContact(); break; case "editcontact": helper.EditContact(); break; case "deletecontact": helper.DeleteContact(); break; case "showcontact": //查询联系人 msg = helper.ShowContact(); break; case "getallcontactofcust": helper.GetAllContactOfCust(); break; case "bindcontactdepartment": //绑定联系人部门 msg = helper.BindContactDepartment(); break; case "getmanagecontactinfo": //判断会员是否存在车易通负责人 msg = helper.GetManageContactInfo(); break; case "getmember": //获取关联会员 msg = helper.GetMappingMember(); break; default: success = false; msg = "请求参数错误"; break; } AJAXHelper.WrapJsonResponse(success, result, msg); } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "", ex.Message); } }
public void ProcessRequest(HttpContext context) { // BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); if (UserRightsService.CheckLoginUserIDByCookies(LoginCookiesContent) > 0) { System.Diagnostics.Debug.WriteLine("[Handler]ProcessRequest begin..."); context.Response.ContentType = "text/plain"; if (!BLL.Util.CheckButtonRight("SYS024BUT40110101")) { AJAXHelper.WrapJsonResponse(false, "", "对不起,您还没有导入操作的权限"); return; } try { switch (Action) { case "batchimport": string msg = ""; //AJAXHelper.WrapJsonResponse(BatchImport(out msg), "", msg); if (BatchImport(out msg)) { if (msg.Length > 0) { msg = "{success:'false',result:'yes',msg:'部分操作失败:<br/>" + msg + "'}"; } else { msg = "{success:'true',result:'yes',msg:'保存成功'}"; } } else { msg = "{success:'false',result:'no',msg:'操作失败:<br/>" + msg + "'}"; } context.Response.Write(msg); break; default: AJAXHelper.WrapJsonResponse(false, "", "没有对应的操作"); break; } } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "", ex.Message); } } else { context.Response.Write("{success:'false',result:'no',msg:'操作失败:<br/>}"); } }
public void ProcessRequest(HttpContext context) { try { BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); bool flag = true; string msg = ""; JavaScriptSerializer jserializer = new JavaScriptSerializer(); switch (Action) { case "GetWOrderProcessByOrderID": List <WOrderProcessInfo> ListProcess = GetWOrderProcessByOrderID(ref flag, ref msg); AJAXHelper.WrapJsonResponse(flag, msg, jserializer.Serialize(ListProcess)); break; case "GetAttachmentProcessListByOrderID": List <CommonAttachmentInfo> listAttach = GetAttachmentProcessListByOrderID(ref flag, ref msg); AJAXHelper.WrapJsonResponse(flag, msg, jserializer.Serialize(listAttach)); break; case "GetCallReportByOrderID": List <RetWOrderData> list2 = GetCallReportByOrderID(ref flag, ref msg); AJAXHelper.WrapJsonResponse(flag, msg, jserializer.Serialize(list2)); break; case "GetReceiverPeopleByOrderID": List <WOrderToAndCCInfo> listRecevier = GetReceiverPeopleByOrderID(ref flag, ref msg); AJAXHelper.WrapJsonResponse(flag, msg, jserializer.Serialize(listRecevier)); break; case "SaveProcess": string data = SaveProcess(ref flag, ref msg); AJAXHelper.WrapJsonResponse(flag, data, msg); break; default: AJAXHelper.WrapJsonResponse(false, "没有对应的操作", "没有对应的操作"); break; } } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "操作失败!", ex.Message); } }
public void ProcessRequest(HttpContext context) { string fileName = ""; string filePath = ""; try { //BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); if (UserRightsService.CheckLoginUserIDByCookies(LoginCookiesContent) > 0) { ReturnVisitAssignImportHelper helper = new ReturnVisitAssignImportHelper(); switch (helper.Action) { case "batchimport": string msg = ""; JavaScriptSerializer jsserializer = new JavaScriptSerializer(); AJAXHelper.WrapJsonResponse(helper.BatchImport(out msg, out fileName, out filePath), msg, jsserializer.Serialize(new ReturnVisitFile() { fileName = fileName, filePath = filePath })); break; case "updatereturnvisit": fileName = context.Request["fileName"]; filePath = context.Request["filePath"]; string updateflag = context.Request["updateflag"]; bool flag = helper.UpdateImport(fileName, filePath, updateflag); AJAXHelper.WrapJsonResponse(flag, "", ""); break; default: AJAXHelper.WrapJsonResponse(false, "", "没有对应的操作"); break; } } } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "分配失败!", ex.Message); } }
public void ProcessRequest(HttpContext context) { try { switch (Action) { case "imgImport": if (UserRightsService.CheckLoginUserIDByCookies(LoginCookiesContent) > 0) { string msg = ""; bool flag; UploadIMGModel retModel = UploadOfficeSupplyImg(out msg, out flag); JavaScriptSerializer jsserializer = new JavaScriptSerializer(); AJAXHelper.WrapJsonResponse(flag, msg, jsserializer.Serialize(retModel)); } break; case "deleteIMG": if (UserRightsService.CheckLoginUserIDByCookies(LoginCookiesContent) > 0) { bool flagDel = DeleteIMG(); AJAXHelper.WrapJsonResponse(flagDel, ",请重新删除!", ""); } break; case "getSysLoginCookieName": AJAXHelper.WrapJsonResponse(true, BitAuto.ISDC.CC2012.BLL.Util.SysLoginCookieName, ""); break; default: AJAXHelper.WrapJsonResponse(false, "没有对应的操作", "没有对应的操作"); break; } } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "操作失败!", ex.Message); } }
public void ProcessRequest(HttpContext context) { try { BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); bool success = true; string result = ""; string msg = ""; switch (helper.Action) { case "verifysavecheckinfo": //验证保存核实信息 helper.VerifySaveCheckInfo(); break; case "savecheckinfo": //保存核实信息 helper.SaveCheckInfo(); break; //case "savecustinfo"://保存核实中的客户信息 // helper.SaveCustInfo(); // break; case "submitcheckinfo": //提交核实信息 helper.SubmitCheckInfo(); break; case "deletecheckinfo": //提交删除核实信息 helper.DeleteCheckInfo(); break; case "custnameexist": //用户名是否存在 result = helper.CustNameExist(out msg) ? "1" : "0"; break; case "searchcustnamesamelist": //客户名称重复列表,包含(客户名称、客户编号、客户状态、锁定状态) result = helper.GetCustNameList(); break; case "adddeletecustrelationinfo": //添加删除客户关系记录 helper.AddDeleteCustRelationInfo(); break; case "stopcheckinfo": //提交停用客户信息 helper.StopCustInfo(); break; case "checkislock": helper.CustIsLock(); break; default: success = false; msg = "请求参数错误"; break; } AJAXHelper.WrapJsonResponse(success, result, msg); } catch (Exception ex) { AJAXHelper.WrapJsonResponse(false, "", ex.Message); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; currentContext = context; BitAuto.YanFa.SysRightManager.Common.UserInfo.Check(); //添加用户信息 if (context.Request.QueryString["add"] != null && context.Request.QueryString["add"] == "yes") { BitAuto.YanFa.Crm2009.Entities.ContactInfo model = new BitAuto.YanFa.Crm2009.Entities.ContactInfo(); model.PID = Convert.ToInt32(RequestPid); model.CustID = RequestCustID; model.CName = RequestCName; model.EName = RequestEName; model.Sex = RequestSex; model.DepartMent = RequestDepartMent; model.OfficeTypeCode = int.Parse(RequestOfficeTypeCode.Trim()); model.Title = RequestTitle; model.OfficeTel = RequestOfficeTel; model.Phone = RequestPhone; model.Email = RequestEmail; model.Fax = RequestFax; model.Remark = RequestReamrk; model.CreateTime = DateTime.Now; model.Status = 0; model.Address = RequestAddress; model.ZipCode = RequestZipCode; model.MSN = RequestMsn; model.Birthday = RequestBirthday; model.Hobby = Hobby; model.Responsible = Responsible; model.CreateUserID = BLL.Util.GetLoginUserID(); int contactID = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.InsertContactInfo(model); if (contactID > 0) { int userid = model.CreateUserID; //插入CC添加联系人记录日志 BLL.ProjectTask_ReturnVisit.Instance.InsertCCAddCRMContractLogForRV(contactID, userid); // message = "Add:'yes'"; AddContactUserMapping(contactID); //负责会员处理(按顺序执行) YesSelectMemberHandle(contactID); NotSelectMemberHandle(contactID); YesSelectMainHandle(contactID); NotSelectMainHandle(contactID); //添加日志记录 BY cheng ON 2011-08-12 string content = string.Format("为【{0}(ID:{1})】添加联系人【{2}】成功。", BitAuto.YanFa.Crm2009.BLL.AllCusts.Instance.GetCustName(model.CustID), model.CustID, model.CName); BitAuto.YanFa.SysRightManager.Common.LogInfo.Instance.InsertLog(BitAuto.YanFa.Crm2009.BLL.LogModule.ContactInfo, (int)BitAuto.YanFa.SysRightManager.Common.LogInfo.ActionType.Add, content); message = "Add:'yes',Edit:'no'"; } else { message = "Add:'no'"; } context.Response.Write("{" + message + "}"); context.Response.End(); } //编辑用户信息 else if (context.Request.QueryString["edit"] != null && context.Request.QueryString["edit"] == "yes") { BitAuto.YanFa.Crm2009.Entities.ContactInfo model = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetContactInfoByUserID(RequestID); if (model != null) { model.PID = Convert.ToInt32(RequestPid); model.CName = RequestCName; model.EName = RequestEName; model.Sex = RequestSex; model.DepartMent = RequestDepartMent; int typecode = 0; Int32.TryParse(RequestOfficeTypeCode, out typecode); model.OfficeTypeCode = typecode; model.Title = RequestTitle; model.OfficeTel = RequestOfficeTel; model.Phone = RequestPhone; model.Email = RequestEmail; model.Fax = RequestFax; model.Remark = RequestReamrk; model.Address = RequestAddress; model.ZipCode = RequestZipCode; model.MSN = RequestMsn; model.Birthday = RequestBirthday; model.Hobby = Hobby; model.Responsible = Responsible; model.ModifyTime = DateTime.Now; model.ModifyUserID = BLL.Util.GetLoginUserID(); //添加日志记录 BY cheng ON 2011-08-12 string content = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetUpdateContent(model, "{0}由【{1}】修改为【{2}】", ','); if (BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.UpdateContactInfo(model) > 0) { message = "Add:'yes'"; EditContactUserMapping(model.ID); //负责会员处理(按顺序执行) YesSelectMemberHandle(RequestID); NotSelectMemberHandle(RequestID); YesSelectMainHandle(RequestID); NotSelectMainHandle(RequestID); try { content = string.Format("为【{0}(ID:{1})】修改联系人【{2}】:{3}。", BitAuto.YanFa.Crm2009.BLL.AllCusts.Instance.GetCustName(model.CustID), model.CustID, model.CName, content); BitAuto.YanFa.SysRightManager.Common.LogInfo.Instance.InsertLog(BitAuto.YanFa.Crm2009.BLL.LogModule.ContactInfo, (int)BitAuto.YanFa.SysRightManager.Common.LogInfo.ActionType.Update, content); message = "Add:'yes',Edit:'yes'"; } catch (Exception ex) { message = ex.Message; } } else { message = "Add:'no'"; } } else { message = "Add:'no'"; } context.Response.Write("{" + message + "}"); context.Response.End(); } //获取一条记录 else if (context.Request.QueryString["show"] != null && context.Request.QueryString["show"] == "yes") { BitAuto.YanFa.Crm2009.Entities.ContactInfo model = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetContactInfoByUserID(RequestID); if (model != null) { model.CreateUserTrueName = GetUserInfoTrueName(model.CreateUserID); model.CreateTimeFormat = string.Format("{0:yyyy-MM-dd}", model.CreateTime); model.ModifyUserTrueName = GetUserInfoTrueName(model.ModifyUserID); model.ModifyTimeFormat = string.Format("{0:yyyy-MM-dd}", model.ModifyTime); string strwhere = " ContactID = '" + model.ID.ToString() + "' and Status=0 "; DataSet dstSet = BitAuto.YanFa.Crm2009.BLL.ContactUserMapping.Instance.GetList(strwhere); for (int i = 0; i < dstSet.Tables[0].Rows.Count; i++) { model.ContactUserS += GetTrueName(dstSet.Tables[0].Rows[i]["UserID"].ToString()) + ","; model.hid_ContactUserS += dstSet.Tables[0].Rows[i]["UserID"] + ","; } result = JavaScriptConvert.SerializeObject(model); message = "yes"; } else { success = false; message = "no"; } AJAXHelper.WrapJsonResponse(success, result, message); } //删除一条记录 else if (context.Request["action"] != null && context.Request["action"] == "DeleteContact") { BitAuto.YanFa.Crm2009.Entities.ContactInfo contact = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetContactInfoByUserID(RequestID); if (contact != null) { //删除CC添加联系人记录日志 BLL.ProjectTask_ReturnVisit.Instance.DeleteCCAddCRMContractLogForRV(RequestID); // BitAuto.YanFa.Crm2009.BLL.ContactUserMapping.Instance.DeleteByContactID(contact.ID); //删除会员联系人关联关系 BitAuto.YanFa.Crm2009.BLL.MemberContactMapping.Instance.DeleteByContactID(contact.ID); if (BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.Delete(RequestID) > 0) { message = "yes";//成功 //添加日志记录 BY cheng ON 2011-08-12 string content = string.Format("为【{0}(ID:{1})】删除联系人【{2}】。", BitAuto.YanFa.Crm2009.BLL.AllCusts.Instance.GetCustName(contact.CustID), contact.CustID, contact.CName); BitAuto.YanFa.SysRightManager.Common.LogInfo.Instance.InsertLog(BitAuto.YanFa.Crm2009.BLL.LogModule.ContactInfo, (int)BitAuto.YanFa.SysRightManager.Common.LogInfo.ActionType.Delete, content); } else { success = false; message = "no";//失败 } } AJAXHelper.WrapJsonResponse(success, result, message); } //通过CustID获取获取直接上级 else if ((context.Request["action"] + "").Trim() == "DropDownListPID") { StringBuilder sb = new StringBuilder(); DataTable dt = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetContactInfoPID(RequestCustID); if (dt != null) { foreach (DataRow dr in dt.Rows) { sb.Append("{'ID':'" + dr["ID"] + "','Name':'" + dr["CName"] + "'},"); } message = sb.ToString().TrimEnd(",".ToCharArray()); } else { message = sb.ToString(); } context.Response.Write("[" + message + "]"); context.Response.End(); } //通过CustID获取获取直接上级 else if ((context.Request["action"] + "").Trim() == "BindContactDepartment") { string strWhere = ""; string filedOrder = ""; StringBuilder sb = new StringBuilder(); if ((context.Request["type"] + "").Trim() == "friend") { FriendInfo model = BitAuto.YanFa.Crm2009.BLL.FriendInfo.Instance.GetFriendInfo(context.Request["CustID"]); if (context.Request["CustID"] != "0") { if (model != null) { strWhere = "TypeID='" + model.FriendCategoryID + "'"; filedOrder = " sort asc"; if (model.FriendCategoryID.Trim() == "") { sb.Append("{'ID':'1','Name':'error'},"); } } else { strWhere = "lb='0'"; } } else { strWhere = "lb='0'"; } } else if ((context.Request["type"] + "").Trim() == "customer") { BitAuto.YanFa.Crm2009.Entities.CustInfo model = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(context.Request["CustID"]); if (context.Request["CustID"] != "0") { if (model != null) { strWhere = "TypeID='" + model.TypeID + "'"; filedOrder = " sort asc"; if (model.TypeID.Trim() == "") { sb.Append("{'ID':'0','Name':'error'},"); } } else { strWhere = "lb='1'"; } } else { strWhere = "lb='1'"; } } DataSet dt = BitAuto.YanFa.Crm2009.BLL.ContactUserDepartment.Instance.GetList(-1, strWhere, filedOrder); if (dt != null) { foreach (DataRow dr in dt.Tables[0].Rows) { sb.Append("{'ID':'" + dr["DepartmentID"] + "','Name':'" + dr["DepartmentName"] + "'},"); } message = sb.ToString().TrimEnd(",".ToCharArray()); } else { message = sb.ToString(); } context.Response.Write("[" + message + "]"); context.Response.End(); } else if ((context.Request["showContactInfo"] + "").Trim() == "yes") { StringBuilder sb = new StringBuilder(); QueryContactInfo queryContactInfo = new QueryContactInfo(); queryContactInfo.CustID = RequestCustID; int o; DataTable dt = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetContactInfo(queryContactInfo, "", 1, 10000, out o); if (dt != null) { foreach (DataRow dr in dt.Rows) { string tel = ""; if (dr["Phone"] != DBNull.Value) { tel += dr["Phone"].ToString().Trim() + ","; } if (dr["OfficeTel"] != DBNull.Value) { tel += dr["OfficeTel"].ToString().Trim() + ","; } sb.Append("{'ID':'" + dr["ID"] + "','Name':'" + dr["CName"] + "','Tel':'" + tel.Trim(',') + "'},"); } message = sb.ToString().TrimEnd(",".ToCharArray()); } else { message = sb.ToString(); } context.Response.Write("[" + message + "]"); context.Response.End(); } else if ((context.Request["showContactInfobycustid"] + "").Trim() == "yes") { StringBuilder sb = new StringBuilder(); DataTable dt = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetContactInfoByCustID(RequestCustID); if (dt != null) { foreach (DataRow dr in dt.Rows) { string tel = ""; if (dr["Phone"] != DBNull.Value) { tel += dr["Phone"].ToString().Trim() + ","; } if (dr["OfficeTel"] != DBNull.Value) { tel += dr["OfficeTel"].ToString().Trim() + ","; } sb.Append("{'ID':'" + dr["ID"] + "','Name':'" + dr["CName"] + "','Tel':'" + tel.Trim(',') + "','DepartMent':'" + dr["DepartMent"] + "'},"); } message = sb.ToString().TrimEnd(",".ToCharArray()); } else { message = sb.ToString(); } context.Response.Write("[" + message + "]"); context.Response.End(); } else if (context.Request["action"].Trim() == "getmember") { message = GetMappingMember(); context.Response.Write(message); context.Response.End(); } else if (context.Request["action"].Trim() == "ishasmanager") { message = GetManageContactInfo(); context.Response.Write(message); context.Response.End(); } else { success = false; message = "request error"; AJAXHelper.WrapJsonResponse(success, result, message); } }