public ActionResult Create() { int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); objQualService = new EmpQualificationService(); List <EmpQualificationItem> listQual = new List <EmpQualificationItem>(); listQual = objQualService.ExperienceListData(Empid); ViewBag.Empid = Empid; EmpQualificationItem objQualitem = new EmpQualificationItem(); objQualitem.ListQualification = new List <EmpQualificationItem>(); objQualitem.ListQualification.AddRange(listQual); List <clsMasterData> lstMaster = new List <clsMasterData>(); lstMaster = objQualService.GetALLIComp(); objQualitem.ListMasterDetails = new List <clsMasterData>(); objQualitem.ListMasterDetails.AddRange(lstMaster); listQual = objQualService.GetQualificationDoc(Empid); objQualitem.ListQualificationDoc = new List <EmpQualificationItem>(); objQualitem.ListQualificationDoc.AddRange(listQual); ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objQualitem)); }
public int Update(EmpQualificationItem model) { Mapper.CreateMap <EmpQualificationItem, EmployeeQualification>(); EmployeeQualification objQual = DBcontext.EmployeeQualifications.SingleOrDefault(m => m.Qid == model.Qid); objQual = Mapper.Map(model, objQual); return(DBcontext.SaveChanges()); }
public EmpQualificationItem GetById(int id) { try { Mapper.CreateMap <EmployeeQualification, EmpQualificationItem>(); EmployeeQualification objQual = DBcontext.EmployeeQualifications.SingleOrDefault(m => m.Qid == id); EmpQualificationItem objQualItem = Mapper.Map <EmpQualificationItem>(objQual); return(objQualItem); } catch (Exception ex) { throw ex; } }
public int Insert(EmpQualificationItem model) { try { Mapper.CreateMap <EmpQualificationItem, EmployeeQualification>(); EmployeeQualification objQual = Mapper.Map <EmployeeQualification>(model); DBcontext.EmployeeQualifications.Add(objQual); return(DBcontext.SaveChanges()); } catch (Exception) { throw; } }
public ActionResult delete(int id, int QId, int menuid) { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); EmpQualificationService objService = new EmpQualificationService(); List <EmpQualificationItem> lstItem = new List <EmpQualificationItem>(); EmpQualificationItem objDoc = new EmpQualificationItem(); objDoc = objService.GetById(QId); db.EmployeeQualifications.Remove(db.EmployeeQualifications.Find(QId)); db.SaveChanges(); //ViewBag.Empid = Empid; ViewBag.Menuid = Request.QueryString["menuId"]; return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] })); }
public ActionResult Create(EmpQualificationItem model) { int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); model.Empid = Empid; objQualService = new EmpQualificationService(); string uid = null; if (Session["UserId"] != null) { uid = Session["UserId"].ToString(); } model.CreatedDate = System.DateTime.Now; model.CreatedBy = uid; objQualService.Insert(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
public ActionResult View(int id, int VQid) { objQualService = new EmpQualificationService(); EmpQualificationItem objQualItem = new EmpQualificationItem(); objQualItem = objQualService.GetById(VQid); //Session["Empid"] = objExpItem.EmpId; List <EmpQualificationItem> lstDl = new List <EmpQualificationItem>(); objQualItem.ListQualification = new List <EmpQualificationItem>(); objQualItem.ListQualification.AddRange(lstDl); List <clsMasterData> lstMaster = new List <clsMasterData>(); lstMaster = objQualService.GetALLIComp(); objQualItem.ListMasterDetails = new List <clsMasterData>(); objQualItem.ListMasterDetails.AddRange(lstMaster); ViewBag.Menuid = Request.QueryString["menuId"]; ViewBag.VQid = VQid; return(View(objQualItem)); }