public async Task <JsonResult> UALInsert() { try { var id = Guid.Parse(Request.Form["id"]); var uid = Guid.Parse(Request.Form["uid"]); var alid = Guid.Parse(Request.Form["alid"]); var aid = Guid.Parse(Request.Form["aid"]); var dtid = Guid.Parse(Request.Form["dtid"]); var ia = Boolean.Parse(Request.Form["ia"]); if (UserAccessLevelService.Insert(id, uid, alid, aid, dtid, ia)) { return(Success(id.ToString())); } return(Failed(MessageUtilityService.FailedInsert(""))); } catch { return(Failed(MessageUtilityService.ServerError())); } }
private static bool InsertUserAccessLevel(Guid aid, Guid uid) { try { var dtid = Guid.NewGuid(); var ualID = Guid.NewGuid(); DateTimeStorageService.Insert(dtid, ualID, aid, DateTime.Now, DateTime.Now, Guid.Parse("c4926f90-2be8-4c62-94ed-5399be276f11")); //check if application exist and user exist if (ApplicationInformationService.IsApplicationExist(aid) && UsersService.IsUserExist(uid)) { //insert new user access level for this user var ual = Guid.Parse("a2e2d83d-dd8d-4a66-bacf-94ad90344ca7"); UserAccessLevelService.Insert(ualID, uid, ual, aid, dtid, false); } return(true); } catch { return(false); } }