/// <summary> /// 保存应用Token和EncodingAESKey /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void SAVEMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { JH_Auth_Model model = JsonConvert.DeserializeObject <JH_Auth_Model>(P1); if (model.ID != 0) { if (string.IsNullOrEmpty(model.AppID)) { msg.ErrorMsg = "至少选择一个企业号应用才能绑定"; return; } if (model.AppType == "1" && (string.IsNullOrEmpty(model.Token) || string.IsNullOrEmpty(model.EncodingAESKey))) { msg.ErrorMsg = "Token、EncodingAESKey、企业号应用不能为空"; } else { new JH_Auth_ModelB().Update(model); } } else { msg.ErrorMsg = "绑定失败"; } }
public void SAVEYY(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { JH_Auth_Model MODEL = JsonConvert.DeserializeObject <JH_Auth_Model>(P1); new JH_Auth_ModelB().Update(MODEL); List <JH_Auth_Function> FUNLIST = JsonConvert.DeserializeObject <List <JH_Auth_Function> >(P2); FUNLIST.ForEach(d => d.CRDate = DateTime.Now); FUNLIST.ForEach(d => d.CRUser = UserInfo.User.UserName); FUNLIST.ForEach(d => d.ComId = 0); FUNLIST.ForEach(d => d.ModelID = MODEL.ID); FUNLIST.ForEach(d => d.ActionData = "[]"); foreach (JH_Auth_Function item in FUNLIST) { if (item.ID == 0) { //新增 new JH_Auth_FunctionB().Insert(item); } else { new JH_Auth_FunctionB().Update(item); //更新 } } string delid = context.Request["DIDS"] ?? ""; if (delid.Trim(',') != "") { new JH_Auth_FunctionB().ExsSclarSql("delete JH_Auth_Function where id in ('" + delid.ToFormatLike(',') + "')"); //删除 } string MENUData = context.Request["MENU"] ?? ""; if (MENUData.Trim(',') != "") { new JH_Auth_CommonB().Delete(d => d.ModelCode == MODEL.ModelCode); List <JH_Auth_Common> MENUS = JsonConvert.DeserializeObject <List <JH_Auth_Common> >(MENUData); MENUS.ForEach(d => d.CRDate = DateTime.Now); MENUS.ForEach(d => d.CRUser = UserInfo.User.UserName); MENUS.ForEach(d => d.ModelCode = MODEL.ModelCode); new JH_Auth_CommonB().Insert(MENUS); } }
public void ADDYY(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { JH_Auth_Model MODELO = JsonConvert.DeserializeObject <JH_Auth_Model>(P1); JH_Auth_Model MODEL = new JH_Auth_Model(); MODEL.ModelCode = MODELO.ModelCode; MODEL.PModelCode = MODELO.PModelCode; MODEL.ModelType = MODELO.ModelType; MODEL.ModelName = MODELO.ModelName; MODEL.ORDERID = MODELO.ORDERID; MODEL.WXUrl = MODELO.WXUrl; MODEL.ModelStatus = "0"; MODEL.IsSQ = "1"; MODEL.CRDate = DateTime.Now; MODEL.CRUser = UserInfo.User.UserName; MODEL.ComId = 0; MODEL.AppType = "1"; MODEL.IsSys = 1; MODEL.IsKJFS = 0; new JH_Auth_ModelB().Insert(MODEL); }