public void Deletecommentrecord(int Id, int Users) { ViewSkillsViewModel model = new ViewSkillsViewModel(); Employee_Endrosement_Comments _skills = _db.Employee_Endrosement_Comments.Where(x => x.Id == Id).FirstOrDefault(); _skills.Archived = true; _skills.LastModified = DateTime.Now; _skills.UserIDLastModifiedBy = Users; _db.SaveChanges(); }
public void SaveAssignEndrosementSet(ViewSkillsViewModel model) { if (model.EndrosementId > 0) { Employee_AddEndrosementSkills _skills = _db.Employee_AddEndrosementSkills.Where(x => x.Id == model.EndrosementId).FirstOrDefault(); //List<Employee_Endrosement_Comments> _Comment = _db.Employee_Endrosement_Comments.Where(x => x.EndrosementId == _skills.Id).ToList(); _skills.EmployeeId = model.EmployeeUserId; _skills.AssignSkillId = model.AssignUser; _skills.SkillsName = _db.SkillSets.Where(x => x.Id == model.Id).FirstOrDefault().Name; _skills.Archived = false; _skills.UserIDCreatedBy = model.EmployeeUserId; _skills.CreatedDate = DateTime.Now; _skills.SkilsId = model.Id; _skills.IsRead = false; //_skills.Commnets = model.Comments; _skills.SkillType = _db.SkillSets.Where(x => x.Id == model.Id).FirstOrDefault().SkillType; _db.SaveChanges(); } else { Employee_AddEndrosementSkills _skills = new Employee_AddEndrosementSkills(); _skills.EmployeeId = model.EmployeeUserId; _skills.AssignSkillId = model.AssignUser; if (model.Id > 0) { _skills.SkillsName = _db.SkillSets.Where(x => x.Id == model.Id).FirstOrDefault().Name; } _skills.Archived = false; _skills.SkilsId = model.Id; _skills.UserIDCreatedBy = model.EmployeeUserId; _skills.CreatedDate = DateTime.Now; _skills.IsRead = false; if (model.Id > 0) { _skills.SkillType = _db.SkillSets.Where(x => x.Id == model.Id).FirstOrDefault().SkillType; } //_skills.Commnets = model.Comments; _db.Employee_AddEndrosementSkills.Add(_skills); _db.SaveChanges(); if (model.Comments != null) { Employee_Endrosement_Comments c_skills = new Employee_Endrosement_Comments(); c_skills.EndrosementId = _skills.Id; c_skills.Archived = false; c_skills.UserIDCreatedBy = model.CurrentUserId; c_skills.Comments = model.Comments; c_skills.LastModified = DateTime.Now; _db.Employee_Endrosement_Comments.Add(c_skills); _db.SaveChanges(); } } }
public void DeleteEndrosmentrecord(int Id, int Users) { ViewSkillsViewModel model = new ViewSkillsViewModel(); Employee_AddEndrosementSkills _skills = _db.Employee_AddEndrosementSkills.Where(x => x.Id == Id).FirstOrDefault(); var _skillscomment = _db.Employee_Endrosement_Comments.Where(x => x.EndrosementId == Id).ToList(); foreach (var item in _skillscomment) { Employee_Endrosement_Comments _skill_commnet = _db.Employee_Endrosement_Comments.Where(x => x.Id == item.Id).FirstOrDefault(); _skills.Archived = true; _skills.LastModified = DateTime.Now; _skills.UserIDLastModifiedBy = Users; _db.SaveChanges(); } _skills.Archived = true; _skills.LastModified = DateTime.Now; _skills.UserIDLastModifiedBy = Users; _db.SaveChanges(); }
public void SaveCommentRecords(ViewSkillsViewModel model) { if (model.Id > 0) { Employee_Endrosement_Comments _skills = _db.Employee_Endrosement_Comments.Where(x => x.Id == model.Id).FirstOrDefault(); _skills.EndrosementId = model.EndrosementId; _skills.Archived = false; _skills.UserIDCreatedBy = model.CurrentUserId; _skills.Comments = model.Comments; _skills.LastModified = DateTime.Now; _db.SaveChanges(); } else { Employee_Endrosement_Comments _skills = new Employee_Endrosement_Comments(); _skills.EndrosementId = model.EndrosementId; _skills.Archived = false; _skills.UserIDCreatedBy = model.CurrentUserId; _skills.Comments = model.Comments; _skills.CreatedDate = DateTime.Now; _db.Employee_Endrosement_Comments.Add(_skills); _db.SaveChanges(); } }