Exemple #1
0
 private void CRM_Login(HttpContext context)
 {
     try
     {
         Hashtable ht = new Hashtable();
         ht.Add("Name", HttpUtility.UrlDecode(context.Request["Name"].SafeToString()));
         ht.Add("Key", context.Request["Key"].SafeToString());
         ht.Add("Status", context.Request["Status"].SafeToString());
         ht.Add("OrgNo", context.Request["OrgNo"].SafeToString());
         ht.Add("IsStu", context.Request["IsStu"].SafeToString());
         ht.Add("Phone", context.Request["Phone"].SafeToString());
         ht.Add("IDCard", context.Request["IDCard"].SafeToString());
         CRM_JsonModel crm_jsonModel = new CRM_JsonModel()
         {
             errNum = 0, errMsg = "success", retData = ""
         };
         crm_jsonModel = bll.CRM_Login(ht);
         context.Response.Write("{\"result\":" + jss.Serialize(crm_jsonModel) + "}");
         context.Response.End();
     }
     catch (Exception ex)
     {
         jsonModel = new JsonModel()
         {
             errNum  = 400,
             errMsg  = ex.Message,
             retData = ""
         };
         LogService.WriteErrorLog(ex.Message);
     }
 }
        public CRM_JsonModel CRM_Login(Hashtable ht, string where = "")
        {
            int       RowCount = 0;
            BLLCommon common   = new BLLCommon();

            try
            {
                DataTable modList = CurrentDal.GetListByPage(ht, out RowCount, false, where);
                //定义JSON标准格式实体中
                CRM_JsonModel jsonModel = null;
                if (modList == null || modList.Rows.Count <= 0)
                {
                    jsonModel = new CRM_JsonModel()
                    {
                        errNum  = 999,
                        errMsg  = "无数据",
                        retData = ""
                    };
                    return(jsonModel);
                }
                DataTable orgDt = new Sys_RoleOfUserDal().GetUserByRegisterOrg(modList.Rows[0]["RegisterOrg"].ToString());
                List <Dictionary <string, object> > list    = new List <Dictionary <string, object> >();
                List <Dictionary <string, object> > orglist = new List <Dictionary <string, object> >();
                list      = common.DataTableToList(modList);
                orglist   = common.DataTableToList(orgDt);
                jsonModel = new CRM_JsonModel()
                {
                    errNum  = 0,
                    errMsg  = "success",
                    retData = list,
                    orgData = orglist
                };
                return(jsonModel);
            }
            catch (Exception ex)
            {
                CRM_JsonModel jsonModel = new CRM_JsonModel()
                {
                    errNum  = 400,
                    errMsg  = ex.Message,
                    retData = ""
                };
                return(jsonModel);
            }
        }