public ApiResult GetCredentialSDO(ApiParam <string> param) { try { TokenManager mng = new TokenManager(); ApiResultObject <List <AasCredentialSDO> > result = mng.GetTokenDataAlive(param.ApiData); return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { DungLH.Util.CommonLogging.LogSystem.Error(ex); return(null); } }
public ApiResult Delete(ApiParam <ApplicationRole> param) { try { ApiResultObject <bool> result = new ApiResultObject <bool>(false); if (param != null) { AasApplicationRoleManager mng = new AasApplicationRoleManager(param.CommonParam); result = mng.Delete(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public ApiResult Get(ApiParam <ApplicationRoleFilterQuery> param) { try { ApiResultObject <List <ApplicationRole> > result = new ApiResultObject <List <ApplicationRole> >(null); if (param != null) { ApplicationRoleManagerGet mng = new ApplicationRoleManagerGet(param.CommonParam); result = mng.GetResult(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public ApiResult Update(ApiParam <Post> param) { try { ApiResultObject <Post> result = new ApiResultObject <Post>(null); if (param != null) { PcsPostManager mng = new PcsPostManager(param.CommonParam); result = mng.Update(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public ApiResult Unlock(ApiParam <Employee> param) { try { ApiResultObject <Employee> result = new ApiResultObject <Employee>(null); if (param != null && param.ApiData != null) { PcsEmployeeManager mng = new PcsEmployeeManager(param.CommonParam); result = mng.Unlock(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public ApiResult GetView(ApiParam <AasModuleRoleViewFilter> param) { try { ApiResultObject <List <ViewModuleRole> > result = new ApiResultObject <List <ViewModuleRole> >(null); if (param != null) { ModuleRoleManagerGet mng = new ModuleRoleManagerGet(param.CommonParam); result = mng.GetViewResult(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public frmApiParamEdit(int id = 0) { InitializeComponent(); if (id == 0) { data = new Entity.ApiParam(); this.Text = "新增"; } else { this.Text = data.name; } txtKey.DataBindings.Add("Text", data, "key"); txtName.DataBindings.Add("Text", data, "name"); txtDefValue.DataBindings.Add("Text", data, "defValue"); txtNote.DataBindings.Add("Text", data, "note"); }
public ApiResult Create(ApiParam <ModuleRole> param) { try { ApiResultObject <ModuleRole> result = new ApiResultObject <ModuleRole>(null); if (param != null) { AasModuleRoleManager mng = new AasModuleRoleManager(param.CommonParam); result = mng.Create(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public ApiResult Lock(ApiParam <Application> param) { try { ApiResultObject <Application> result = new ApiResultObject <Application>(null); if (param != null && param.ApiData != null) { AasApplicationManager mng = new AasApplicationManager(param.CommonParam); result = mng.Lock(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public ApiResult ResetPassword(ApiParam <long> param) { try { ApiResultObject <bool> result = new ApiResultObject <bool>(false); if (param != null) { AasUserManager mng = new AasUserManager(param.CommonParam); result = mng.ResetPassword(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public ApiResult Unlock(ApiParam <CredentialData> param) { try { ApiResultObject <CredentialData> result = new ApiResultObject <CredentialData>(null); if (param != null && param.ApiData != null) { AasCredentialDataManager mng = new AasCredentialDataManager(param.CommonParam); result = mng.Unlock(param.ApiData); } return(new ApiResult(result, this.ActionContext)); } catch (Exception ex) { LogSystem.Error(ex); return(null); } }
public HttpResponseMessage UpdateEmployee(ApiParam param) { try { var plainPayload = param.Payload.FromBase64(); var payload = JsonConvert.DeserializeObject <dynamic>(plainPayload); Nullable <long> employeeID = payload.employeeID; string fullName = payload.fullName; string position = payload.position; string empCode = payload.empCode; string mobile = payload.mobile; var dbRes = _db.sc_UpdateEmployee(employeeID, fullName, position, empCode, mobile); return(new HttpResponseMessage() { Content = new StringContent( JsonConvert.SerializeObject(new ResponseModel() { Status = 200, Payload = JsonConvert.SerializeObject(dbRes).ToBase64() }), Encoding.UTF8, "application/json") }); } catch (Exception ex) { var exh = new ExceptionHelper(ref ex, false); return(new HttpResponseMessage() { Content = new StringContent( JsonConvert.SerializeObject(new ResponseModel() { Status = 500, Payload = exh.Message.ToBase64() }), Encoding.UTF8, "application/json") }); } }
public HttpResponseMessage ListEmployee(ApiParam param) { try { var plainPayload = param.Payload.FromBase64(); var payload = JsonConvert.DeserializeObject <dynamic>(plainPayload); Nullable <long> employeeID = payload.employeeID; var dbRes = _db.sc_ListEmployee(employeeID).ToList(); return(new HttpResponseMessage() { Content = new StringContent( JsonConvert.SerializeObject(new ResponseModel() { Status = 200, Payload = JsonConvert.SerializeObject(dbRes).ToBase64() }), Encoding.UTF8, "application/json") }); } catch (Exception ex) { var exh = new ExceptionHelper(ref ex, false); return(new HttpResponseMessage() { Content = new StringContent( JsonConvert.SerializeObject(new ResponseModel() { Status = 500, Payload = exh.Message.ToBase64() }), Encoding.UTF8, "application/json") }); } }