Пример #1
0
        public OwnerViewModel(Owner openOwner)
        {
            owner         = openOwner;
            newEmployee   = new tblUser();
            newManager    = new tblManager();
            newStaff      = new tblStaff();
            qualification = new tblProfessionalQualification();
            engagement    = new tblEngagement();
            gender        = new tblGender();

            engagementList    = Service.Service.GetEngagementList();
            qualificationList = Service.Service.GetQualificationList();
            genderList        = Service.Service.GetGenderList();
        }
        public void EnregistrerEngagement(string _nature, DateTime date, int heure, int minutes, string _duree, string _lieu, string _commentaire, string descCourte, string descLongue, string idContrat)
        {
            string nature      = SanitariserTexte(_nature);
            string duree       = SanitariserTexte(_duree);
            string lieu        = SanitariserTexte(_lieu);
            string commentaire = SanitariserTexte(_commentaire);

            //INSERT
            Modele.tblEngagement tE = new tblEngagement()
            {
                nature            = nature,
                date              = date,
                heure             = new TimeSpan(heure, minutes, 0),
                duree             = duree,
                lieu              = lieu,
                commentaire       = commentaire,
                descriptionCourte = descCourte,
                description       = descLongue,
                noContrat         = idContrat
            };
            provider.InsertEngagement(tE);
        }
Пример #3
0
 public void InsertEngagement(tblEngagement tE)
 {
     BD.tblEngagement.Add(tE);
     BD.SaveChanges();
 }
Пример #4
0
        internal void AddEmployee(tblEmployee employee, tblAccount account, string dateOfBirth, tblEngagement Engagement)
        {
            using (HotelEntities1 context = new HotelEntities1())
            {
                DateTime date = DateTime.ParseExact(dateOfBirth, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);

                tblAccount newAccount = new tblAccount();
                newAccount.FullName    = account.FullName;
                newAccount.DateOfBirth = date;
                newAccount.Email       = account.Email;
                newAccount.UserName    = account.UserName;
                newAccount.Pass        = account.Pass;
                context.tblAccounts.Add(newAccount);
                context.SaveChanges();

                tblEmployee newManager = new tblEmployee();
                newManager.AccountID    = newAccount.AccountID;
                newManager.HotelFloor   = employee.HotelFloor;
                newManager.Gender       = employee.Gender;
                newManager.Cityzenship  = employee.Cityzenship;
                newManager.EngagementID = Engagement.EngagementID;
                newManager.Salary       = employee.Salary;
                context.tblEmployees.Add(newManager);
                context.SaveChanges();
            }
        }