Пример #1
0
 public Response SignUp(SignUpRequest request)
 {
     try
     {
         SignUpResponse retval = new SignUpResponse();
         var            gu     = _dal.GetUser(request.Email);
         var            tblga  = gu.Tables[0];
         if (tblga.Rows.Count == 1)
         {
             retval = new SignUpUserNameAlreadyExists();
         }
         else
         {
             var ds  = _dal.CreateUser(request.Email, request.UserName);
             var tbl = ds.Tables[0];
             if (tbl.Rows.Count == 1)
             {
                 if (request.Email == (string)tbl.Rows[0][0] &&
                     request.UserName == (string)tbl.Rows[0][1])
                 {
                     retval = new SignUpResponseOK((string)tbl.Rows[0][0], (string)tbl.Rows[0][1]);
                 }
             }
         }
         return(retval);
     }
     catch (Exception ex)
     {
         return(new AppResponseError(ex.Message));
     }
 }
Пример #2
0
 public Response SignUp(SignUpRequest request)
 {
     try
     {
         var            ds     = _dal.CreateUser(request.EmailAddress, request.UserName);
         SignUpResponse retval = new SignUpResponseEmailAddressExists();
         if (ds.Tables.Count > 0)
         {
             var tbl = ds.Tables[0];
             if (tbl.Rows.Count == 1)
             {
                 if (request.EmailAddress == (string)tbl.Rows[0][0] &&
                     request.UserName == (string)tbl.Rows[0][1])
                 {
                     retval = new SignUpResponseOK();
                 }
             }
         }
         return(retval);
     }
     catch (Exception ex)
     {
         return(new ResponseError(ex.Message));
     }
 }