//validate email address if it is allowed to be used
 private static bool InsertNewUserInformation(Guid userID, Guid aid, Guid locCatID)
 {
     try {
         var dtid = Guid.NewGuid();
         DateTimeStorageService.Insert(dtid, userID, aid, DateTime.Now, DateTime.Now, Guid.Parse("a2e2d83d-dd8d-4a66-bacf-94ad90344ca7"));
         LocationStorageService.Insert(Guid.NewGuid(), userID, locCatID, 0, 0, "User Location", dtid, false);
         return(true);
     } catch { return(false); }
 }
 private bool InsertNewEmailList(Guid id, string name, string email, Guid aid, string cnum)
 {
     try {
         var dtid = Guid.NewGuid();
         var time = DateTime.Now;
         DateTimeStorageService.Insert(dtid, id, aid, time, time, Guid.Parse("931b5cca-e652-49cf-bc6c-ed96cf053604"));
         EmailListService.Insert(id, name, email, dtid, cnum);
         return(true);
     } catch { return(false); }
 }
Beispiel #3
0
 public async Task <JsonResult> DSInsert()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         var ca  = DateTime.Parse(Request.Form["ca"]);
         var ua  = DateTime.Parse(Request.Form["ua"]);
         var cid = Guid.Parse(Request.Form["cid"]);
         if (DateTimeStorageService.Insert(id, oid, aid, ca, ua, cid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedInsert("Date Time")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Beispiel #4
0
 public async Task <JsonResult> DSInsertTZ()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var oid  = Guid.Parse(Request.Form["oid"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         var tz   = Request.Form["tz"];
         var cid  = Guid.Parse(Request.Form["cid"]);
         var time = DateTimeUtil.GetTimeNowByUTC(tz);
         if (DateTimeStorageService.Insert(id, oid, aid, time, time, cid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedInsert("DateTime")));
     } 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); }
 }