public Message Update(Training_EmpEnglishInfo eei) { try { Training_EmpEnglishInfo objDb = GetById(eei.ID); //objDb.EmployeeId = eei.EmployeeId; objDb.ExpireDate = eei.ExpireDate; objDb.Notes = eei.Notes; objDb.Score = eei.Score; objDb.TypeId = eei.TypeId; objDb.UpdateDate = DateTime.Now; objDb.UpdatedBy = HttpContext.Current.User.Identity.Name; dbContext.SubmitChanges(); return new Message(MessageConstants.I0001, MessageType.Info, "English Information of employeee " + eei.EmployeeId, "updated"); } catch { return new Message(MessageConstants.E0007, MessageType.Error); } }
public Message Insert(Training_EmpEnglishInfo eei) { try { eei.CreateDate = eei.UpdateDate = DateTime.Now; eei.CreatedBy = eei.UpdatedBy = HttpContext.Current.User.Identity.Name; dbContext.Training_EmpEnglishInfos.InsertOnSubmit(eei); dbContext.SubmitChanges(); return new Message(MessageConstants.I0001, MessageType.Info, "Employee English Information", "added"); } catch { return new Message(MessageConstants.E0007, MessageType.Error); } }