public JsonResult DeleteApp() { object retJson = new { success = 0, msg = "操作失败" }; JMP.MDL.jmp_app model = new JMP.MDL.jmp_app();//应用实体类 JMP.BLL.jmp_app bll = new JMP.BLL.jmp_app(); int a_id = string.IsNullOrEmpty(Request["a_id"]) ? 0 : Int32.Parse(Request["a_id"].ToString()); if (a_id > 0) { model = bll.GetModel(a_id); model.a_state = -1; if (bll.Update(model)) { // AddLocLog.AddUserLog(Int32.Parse(UserInfo.UserId), 3, RequestHelper.GetClientIp(), "删除应用", "删除应用,应用id为:" + model.a_id); Logger.OperateLog("删除应用", "删除应用"); retJson = new { success = 1, msg = "操作成功" }; } else { retJson = new { success = 0, msg = "操作失败" }; } } return(Json(retJson)); }
public JsonResult DeleteApp() { object retJson = new { success = 0, msg = "操作失败" }; JMP.MDL.jmp_app model = new JMP.MDL.jmp_app();//应用实体类 JMP.BLL.jmp_app bll = new JMP.BLL.jmp_app(); int a_id = string.IsNullOrEmpty(Request["a_id"]) ? 0 : Int32.Parse(Request["a_id"].ToString()); if (a_id > 0) { model = bll.GetModel(a_id); model.a_state = -1; if (bll.Update(model)) { Logger.OperateLog("删除应用", "删除应用ID为'" + a_id + "'"); retJson = new { success = 1, msg = "操作成功" }; } else { retJson = new { success = 0, msg = "操作失败" }; } } return(Json(retJson)); }
public JsonResult InsertUpdateApp(JMP.MDL.jmp_app mod) { object retJson = new { success = 0, msg = "操作失败" }; JMP.BLL.jmp_app bll = new JMP.BLL.jmp_app(); if (mod.a_apptype_id == 0) { retJson = new { success = 0, msg = "请选择应用类型" }; } else { if (mod.a_id > 0) { #region 修改应用 string rzsm = ""; JMP.MDL.jmp_app modapp = new JMP.MDL.jmp_app(); modapp = bll.GetModel(mod.a_id); var modcolne = modapp.Clone(); modapp.a_name = mod.a_name; //应用名称 modapp.a_platform_id = mod.a_platform_id; //关联平台ID modapp.a_paymode_id = mod.a_paymode_id; //关联支付类型ID modapp.a_apptype_id = mod.a_apptype_id; //关联应用类型ID modapp.a_notifyurl = mod.a_notifyurl; //回掉地址 modapp.a_user_id = mod.a_user_id; //开发者ID modapp.a_showurl = mod.a_showurl; //同步地址 modapp.a_appurl = mod.a_appurl; //应用审核地址 modapp.a_appsynopsis = mod.a_appsynopsis; //应用简介 if (bll.Update(modapp)) { Logger.ModifyLog("修改应用", modcolne, mod); retJson = new { success = mod.a_id, msg = "修改成功" }; } else { retJson = new { success = 0, msg = "修改失败" }; } #endregion } else { #region 添加应用 mod.a_rid = 0; mod.a_auditor = ""; mod.a_state = 1; mod.a_auditstate = 0; mod.a_key = ""; mod.a_secretkey = ""; mod.a_time = DateTime.Now; int cg = _AppService.Insert(mod); // int cg = bll.Add(mod); if (cg > 0) { // Logger.CreateLog("新增应用",mod); mod.a_key = DESEncrypt.Encrypt(mod.a_user_id + ";" + cg + ";" + DateTime.Now.ToString("yyyyMMddssmmfff")); mod.a_secretkey = DESEncrypt.Encrypt(cg + ";" + mod.a_key + ";" + DateTime.Now.ToString("yyyyMMddssmmfff")); mod.a_id = cg; if (bll.Update(mod)) { Logger.CreateLog("新增应用", mod); retJson = new { success = 1, msg = "添加成功" }; } else { retJson = new { success = 0, msg = "添加失败" }; } } else { retJson = new { success = 0, msg = "添加失败" }; } #endregion } } return(Json(retJson)); }