Beispiel #1
0
        public void DeleteCertification(EmpCertificationDto empCertification)
        {
            EmpCertification empCert = DataContext.EmpCertifications.FirstOrDefault(ec => ec.EntryID == empCertification.EntryID);

            empCert.IsDeleted = true;
            empCert.UpdateTimeStamp(empCertification.LoggedInUserName);
            DataContext.EmpCertifications.Add(empCert);
            DataContext.Entry(empCert).State = EntityState.Modified;
            DataContext.SaveChanges();
        }
Beispiel #2
0
        public void AddCertification(EmpCertificationDto empCertification)
        {
            EmpCertification empCert = new EmpCertification
            {
                CertificationID = empCertification.CertificationID,
                CertifiedOn     = empCertification.CertifiedOn,
                EmployeeID      = empCertification.EmployeeID,
                ValidUpto       = empCertification.ValidUpto,
            };

            empCert.UpdateTimeStamp(empCertification.LoggedInUserName, true);

            DataContext.EmpCertifications.Add(empCert);
            DataContext.Entry(empCert).State = EntityState.Added;
            DataContext.SaveChanges();
        }