public async Task <JsonResult> ELIsEmailExist()
 {
     try {
         //checks if email exist in the database else create one
         var name  = Request.Form["name"];
         var email = Request.Form["email"];
         var aid   = Guid.Parse(Request.Form["aid"]);
         var cnum  = Request.Form["cnum"];
         var data  = EmailListService.GetByEAdd(email);
         var tz    = Request.Form["tz"];
         if (data != null)
         {
             if (InsertNewEmailList(Guid.NewGuid(), name, email, aid, cnum))
             {
                 return(Success(true));
             }
             return(Failed(MessageUtilityService.ServerError()));
         }
         else
         {
             //update time updated data
             DateTimeStorageService.Update(data.DateTimeID, data.ID, DateTimeStorageService.GetByTZ(tz));
             EmailListService.Update(data.ID, name, data.Email, data.DateTimeID, cnum);
         }
         //email is already registered in the database
         return(Success(false));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Ejemplo n.º 2
0
 public async Task <JsonResult> DSUpdate()
 {
     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"]);
         if (DateTimeStorageService.Update(id, oid, ua))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("DateTime")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }