Esempio n. 1
0
        public ActionResult Signup(UserLoginInfoViewModel s)
        {
            if (ModelState.IsValid)
            {
                BL.BL.Kayit(s);
                s = null;
                ViewBag.Message = "Kayıt Basarılı!";
            }


            return(RedirectToAction("Login", "Account"));
        }
 public ActionResult <UserViewModel> Login(UserLoginInfoViewModel loginInfo)
 {
     return(new UserViewModel
     {
         Id = -1,
         Name = "Perico el de los palotes",
         Login = "******",
         Password = "******",
         Claims = new List <string> {
             "Capitán"
         }
     });
 }
Esempio n. 3
0
 public static void Kayit(UserLoginInfoViewModel s)
 {
     try
     {
         using (CheckinDatasetEntities4 db = new CheckinDatasetEntities4())
         {
             UserLoginInfo yeni = new UserLoginInfo()
             {
                 CITY     = s.CITY,
                 COUNTRY  = s.COUNTRY,
                 EMAIL    = s.EMAIL,
                 ISACTIVE = true,
                 NAME     = s.NAME,
                 PASSWORD = s.PASSWORD,
                 ROLE     = 0,
                 SURNAME  = s.SURNAME,
                 USERNAME = s.USERNAME,
                 USERID   = s.USERID
             };
             db.UserLoginInfo.Add(yeni);
             db.SaveChanges();
         }
     }
     catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)
     {
         Exception raise = dbEx;
         foreach (var validationErrors in dbEx.EntityValidationErrors)
         {
             foreach (var validationError in validationErrors.ValidationErrors)
             {
                 string message = string.Format("{0}:{1}",
                                                validationErrors.Entry.Entity.ToString(),
                                                validationError.ErrorMessage);
                 // raise a new exception nesting
                 // the current instance as InnerException
                 raise = new InvalidOperationException(message, raise);
             }
         }
         throw raise;
     }
 }
 public void Init()
 {
     instance = new UserLoginInfoViewModel();
 }