예제 #1
0
        public string Data_Verify_IfHaveKHRight(string CRMID)         //校验当前人员是否有该客户的操作权限
        {
            token = appClass.CRM_Gettoken();

            int count = crmModels.BC_FXCH.Verify_IfHaveKHRight(appClass.CRM_GetStaffid(), CRMID, token);

            if (count == 0)           //没有该客户的权限
            {
                WebMSG msg = new WebMSG();
                msg.KEY = 0;
                msg.MSG = "当前用户没有该客户的权限";
                return(Newtonsoft.Json.JsonConvert.SerializeObject(msg));
            }
            else               //有该客户的权限
            {
                CRM_Report_KHModel model = new CRM_Report_KHModel();
                model.CRMID    = CRMID;
                model.ISACTIVE = 3;
                CRM_KH_KHList[] data = crmModels.KH_KH.Report(model, appClass.CRM_GetStaffid(), token);
                if (data.Length == 0)
                {
                    WebMSG msg = new WebMSG();
                    msg.KEY = 0;
                    msg.MSG = "找不到该客户";
                    return(Newtonsoft.Json.JsonConvert.SerializeObject(msg));
                }
                else
                {
                    return(Newtonsoft.Json.JsonConvert.SerializeObject(data[0]));
                }
            }
        }
예제 #2
0
        public string Data_SelectKHAcount(string cxdata)
        {
            token = appClass.CRM_Gettoken();
            CRM_Report_KHModel model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_Report_KHModel>(cxdata);

            CRM_KH_KHList[] data = crmModels.KH_KH.ReadKHAcount(model, token);
            return(Newtonsoft.Json.JsonConvert.SerializeObject(data));
        }
예제 #3
0
        public string get_assign_kh(string CRMID, string KHLX, string GID, string MC)
        {
            string             rst   = "";
            CRM_Report_KHModel kh_in = new CRM_Report_KHModel();

            kh_in.CRMID = CRMID;
            kh_in.KHLX  = Convert.ToInt32(KHLX);
            kh_in.GID   = Convert.ToInt32(GID);
            kh_in.MC    = MC;
            CRM_KH_KHList[] list = crmModels.KH_KH.Report(kh_in, Convert.ToInt32(Session["STAFFID"]), Session["token"].ToString());
            rst = Newtonsoft.Json.JsonConvert.SerializeObject(list);
            return(rst);
        }
예제 #4
0
        public string Data_Insert_NoticeMX_AllJXS(int NOTICETTID)
        {
            token = appClass.CRM_Gettoken();

            CRM_Report_KHModel cxmodel = new CRM_Report_KHModel();

            cxmodel.KHLX = 1;
            CRM_KH_KHList[] KHmodel = crmModels.KH_KH.ReadUser_KH(cxmodel, token);
            for (int i = 0; i < KHmodel.Length; i++)
            {
                CRM_HG_STAFF     staff = crmModels.HG_STAFF.ReadBySTAFFNO(KHmodel[i].SAPSN, token);
                CRM_MSG_NOTICEMX model = new CRM_MSG_NOTICEMX();
                model.NOTICETTID = NOTICETTID;
                model.USERID     = staff.STAFFID;
                CRM_MSG_NOTICEMX[] cxdata = crmModels.MSG_NOTICE.ReadMXbyParam(model, token);
                if (cxdata.Length > 0)
                {
                    webmsg.KEY = 0;
                    webmsg.MSG = "数据重复!";
                    return(Newtonsoft.Json.JsonConvert.SerializeObject(webmsg));
                }
            }
            for (int i = 0; i < KHmodel.Length; i++)
            {
                CRM_HG_STAFF     staff = crmModels.HG_STAFF.ReadBySTAFFNO(KHmodel[i].SAPSN, token);
                CRM_MSG_NOTICEMX model = new CRM_MSG_NOTICEMX();
                model.NOTICETTID = NOTICETTID;
                model.USERID     = staff.STAFFID;
                model.USERLX     = 1107;
                model.ISACTIVE   = 1;
                int ii = crmModels.MSG_NOTICE.CreateMX(model, token);
                if (ii <= 0)
                {
                    webmsg.KEY = ii;
                    webmsg.MSG = "第" + (i + 1) + "行数据新建失败!";
                    return(Newtonsoft.Json.JsonConvert.SerializeObject(webmsg));
                }
            }
            webmsg.KEY = 1;
            webmsg.MSG = "新建成功!";

            return(Newtonsoft.Json.JsonConvert.SerializeObject(webmsg));
        }
예제 #5
0
 public string SelectKHReportWithReportModel(CRM_Report_KHModel model)       //查询客户列表
 {
     return(client.SelectReportWithReportModel(model));
 }
예제 #6
0
 public CRM_KH_KHList[] Report_PLUS(CRM_Report_KHModel model, int STAFFID, string ptoken)
 {
     return(client.Report_PLUS(model, STAFFID, ptoken));
 }
예제 #7
0
 public CRM_KH_KHList[] ReadKHAcount(CRM_Report_KHModel model, string ptoken)
 {
     return(client.ReadKHAcount(model, ptoken));
 }
예제 #8
0
 public CRM_KH_KHList[] ReadUser_KH(CRM_Report_KHModel model, string ptoken)
 {
     return(client.ReadUser_KH(model, ptoken));
 }