Example #1
0
 /// <summary>
 /// Create a new Regiune object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="fK_User">Initial value of the FK_User property.</param>
 /// <param name="nume">Initial value of the Nume property.</param>
 public static Regiune CreateRegiune(global::System.Int32 id, global::System.Int32 fK_User, global::System.String nume)
 {
     Regiune regiune = new Regiune();
     regiune.ID = id;
     regiune.FK_User = fK_User;
     regiune.Nume = nume;
     return regiune;
 }
Example #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Regiunes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRegiunes(Regiune regiune)
 {
     base.AddObject("Regiunes", regiune);
 }
Example #3
0
 public bool RegisterUser(string firstname, string lastname, string username, string password, string email, string region)
 {
     dbEntities db = new dbEntities();
     try
     {
         Usr u = new Usr() { Nume = lastname, Prenume = firstname, Usr1 = username, Pass = password, Mail = email, Data_Inreg = DateTime.Now, Data_LastLogIn = DateTime.Now, BaniDonati = 0, NrDonatii = 0, Scor = 10, Rank = "Rank1", IsForDelete = false };
         db.AddToUsrs(u);
         db.SaveChanges();
         //---
         int usrid = db.Usrs.Where<Usr>(x => x.Usr1 == username).ToArray<Usr>()[0].ID;
         Regiune r = new Regiune() { Nume = region, FK_User = usrid };
         db.AddToRegiunes(r);
         db.SaveChanges();
     }
     catch(Exception ex)
     { return false; }
     finally { db.Dispose(); }
     return true;
 }