Ejemplo n.º 1
0
        public static void SaveBd(string surn, string nam, string secNam, string DateB, string DateS, string Sal, string expir, string posit)
        {
            ListOfWorkersEntities bd = new ListOfWorkersEntities();
            Workman per = new Workman();
            per.Surnume = surn;
            per.Name = nam;
            per.SecondName = secNam;
            per.DateOfBirth = DateB;
            per.DateOfStart = DateS;
            per.Salary = Convert.ToInt32(Sal);
            per.Expirience = expir;
            per.Position = posit;

            bd.Workman.AddObject(per);
            bd.SaveChanges();
        }
Ejemplo n.º 2
0
        public static Boolean PersWork(string surn, string name, string sdname, string Dbirth)
        {
            ListOfWorkersEntities bd1 = new ListOfWorkersEntities();
            Workman per1 = new Workman();

            IQueryable<Workman> custQueryn =
                from Workman in bd1.Workman
                where Workman.Surnume == surn & Workman.Name == name & Workman.SecondName == sdname & Workman.DateOfBirth == Dbirth
                select Workman;

            if (custQueryn.Count() == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
 /// <summary>
 /// Create a new Workman object.
 /// </summary>
 /// <param name="personID">Initial value of the PersonID property.</param>
 /// <param name="surnume">Initial value of the Surnume property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="secondName">Initial value of the SecondName property.</param>
 /// <param name="dateOfBirth">Initial value of the DateOfBirth property.</param>
 /// <param name="position">Initial value of the Position property.</param>
 /// <param name="salary">Initial value of the Salary property.</param>
 /// <param name="expirience">Initial value of the Expirience property.</param>
 /// <param name="dateOfStart">Initial value of the DateOfStart property.</param>
 public static Workman CreateWorkman(global::System.Int32 personID, global::System.String surnume, global::System.String name, global::System.String secondName, global::System.String dateOfBirth, global::System.String position, global::System.Int32 salary, global::System.String expirience, global::System.String dateOfStart)
 {
     Workman workman = new Workman();
     workman.PersonID = personID;
     workman.Surnume = surnume;
     workman.Name = name;
     workman.SecondName = secondName;
     workman.DateOfBirth = dateOfBirth;
     workman.Position = position;
     workman.Salary = salary;
     workman.Expirience = expirience;
     workman.DateOfStart = dateOfStart;
     return workman;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Workman EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWorkman(Workman workman)
 {
     base.AddObject("Workman", workman);
 }