public ContentResult DelAgentAppVer(int id) { int iRet = PDAAgentApp.DeleteByID(id); if (iRet > 0) { return(Content("ok")); } else { return(Content("删除失败!")); } }
public ContentResult ToAddAgentApp(FormCollection userform) { string msg = string.Empty; PDAAgentApp app = new PDAAgentApp(); app.Ver = userform["Ver"]; app.AppName = userform["AppName"]; if (userform["IsOK"] != null) { app.IsOK = userform["IsOK"] == "on" ? true : false; } var file = Request.Files[0]; string FilePath = "/File/APP/"; string FileName = ""; string errMsg = ""; if (!FileDeal(Request.Files[0], FilePath, out FileName, out errMsg)) { return(Content(errMsg)); } SizeUnit sizeObj = StorageUnit.AutoConver(Request.Files[0].ContentLength); app.Size = sizeObj.size.ToString() + sizeObj.unit; app.AppName = Request.Files[0].FileName; app.AppPath = FilePath + Request.Files[0].FileName; app.CreatTime = CommonFunc.GetNowTimestamp(); if (app.IsOK) { PDAAgentApp.UpdateIsOK(); } if (app.InsertAndReturnIdentity() > 0) { msg = "ok"; } else { msg = "添加失败!"; } return(Content(msg)); }
public RequestResult GetAgentVersion() { RequestResult result = new RequestResult(); try { PDAAgentApp app = PDAAgentApp.GetDefultScanApp(); app.AppPath = WeConfig.b_domain + app.AppPath; result.data = app; result.message = "成功"; result.success = true; } catch (Exception ex) { result.code = 500; result.message = "服务出错"; result.success = false; DAL.Log.Instance.Write("代理APP更新出错:" + ex.Message, "代理APP更新出错"); } return(result); }
public ActionResult GetAgentAllPdaAPP() { List <PDAAgentApp> ListApp = PDAAgentApp.GetEntitysAll(); return(Json(ListApp, JsonRequestBehavior.AllowGet)); }