public static Esignin adduser(Isignin user) { inc(); try { var validP1 = Database.user.FirstOrDefault(x => x.firstname.ToLower() == user.firsname.ToLower()); var validP2 = Database.user.FirstOrDefault(x => x.lastname.ToLower() == user.lastname.ToLower()); var validP3 = Database.user.FirstOrDefault(x => x.email.ToLower() == user.email.ToLower()); Esignin Nuser = new Esignin { firsname = user.firsname, lastname = user.lastname, email = user.email, password = user.password, Cpassword = user.password, }; if ((validP1 == null || validP2 == null) && validP3 == null) { var x = new users { email = user.email, firstname = user.firsname, lastname = user.lastname, Lastonline = DateTime.Now, start = DateTime.Now, online = false, password = user.password, }; Database.user.Add(x); Database.SaveChanges(); } else { if (validP1 != null && validP2 != null) { Nuser.Efirsname = "نام تکراری"; } if (validP3 != null) { Nuser.Eemail = "ایمیل تکراری"; } } return(Nuser); } catch { return(null); } }
public Esignin Signin(Isignin model) { Esignin user = DAl.manager.adduser(model); return(user); }