public ActionResult EIDReport() { EmpHealthItem data = TempData["data"] as EmpHealthItem; ViewBag.Menuid = Request.QueryString["menuId"]; return(View(data)); }
public int Update(EmpHealthItem model) { Mapper.CreateMap <EmpHealthItem, EmployeeHealthCard>(); EmployeeHealthCard objHealth = DBcontext.EmployeeHealthCards.SingleOrDefault(m => m.HId == model.HId); objHealth = Mapper.Map(model, objHealth); return(DBcontext.SaveChanges()); }
public EmpHealthItem GetById(int id) { try { Mapper.CreateMap <EmployeeHealthCard, EmpHealthItem>(); EmployeeHealthCard objHealth = DBcontext.EmployeeHealthCards.SingleOrDefault(m => m.HId == id); EmpHealthItem objHealthItem = Mapper.Map <EmpHealthItem>(objHealth); return(objHealthItem); } catch (Exception ex) { throw ex; } }
public int Insert(EmpHealthItem model) { try { Mapper.CreateMap <EmpHealthItem, EmployeeHealthCard>(); EmployeeHealthCard objHealth = Mapper.Map <EmployeeHealthCard>(model); DBcontext.EmployeeHealthCards.Add(objHealth); return(DBcontext.SaveChanges()); } catch (Exception) { throw; } }
public ActionResult View(int id, int HCId) { objHealthService = new EmpHealthService(); EmpHealthItem objHealthItem = new EmpHealthItem(); objHealthItem = objHealthService.GetById(HCId); //Session["Empid"] = objHealthItem.EmpId; List <EmpHealthItem> lstHealth = new List <EmpHealthItem>(); objHealthItem.ListHealth = new List <EmpHealthItem>(); objHealthItem.ListHealth.AddRange(lstHealth); ViewBag.HCId = HCId; ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objHealthItem)); }
public ActionResult delete(int id, int HId, int menuid) { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); EmpHealthService objService = new EmpHealthService(); List <EmpHealthItem> lstItem = new List <EmpHealthItem>(); EmpHealthItem objDoc = new EmpHealthItem(); objDoc = objService.GetById(HId); db.EmployeeHealthCards.Remove(db.EmployeeHealthCards.Find(HId)); db.SaveChanges(); //ViewBag.Empid = Empid; ViewBag.Menuid = Request.QueryString["menuId"]; return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] })); }
public ActionResult EIDReport(EmpHealthItem model) { string expdt; if (Convert.ToString(model.withinDays) != "") { expdt = ""; } else { expdt = Convert.ToString(model.ExpiryDate); } EmpHealthItem objAllItem = new EmpHealthItem(); ReportService objclsmethod = new ReportService(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } if (expdt != "") { DateTime date = Convert.ToDateTime(model.ExpiryDate); string day = Convert.ToString(model.withinDays); List <EmpHealthItem> objMaster = objclsmethod.getEIDRpt(date, cid); objAllItem.ListEIDRpt = new List <EmpHealthItem>(); objAllItem.ListEIDRpt.AddRange(objMaster); } else if (Convert.ToString(model.withinDays) != "") { string day = Convert.ToString(model.withinDays); List <EmpHealthItem> objMaster = objclsmethod.getEIDbyDay(day, cid); objAllItem.ListEIDRpt = new List <EmpHealthItem>(); objAllItem.ListEIDRpt.AddRange(objMaster); } else { List <EmpHealthItem> objMaster = objclsmethod.getEIDAllRpt(cid); objAllItem.ListEIDRpt = new List <EmpHealthItem>(); objAllItem.ListEIDRpt.AddRange(objMaster); } TempData["data"] = objAllItem; return(RedirectToAction("EIDReport", new { @menuId = model.Viewbagidformenu })); }
public ActionResult Create(EmpHealthItem model) { model.Status = "Active"; int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); string uid = null; if (Session["UserId"] != null) { uid = Session["UserId"].ToString(); } model.CreatedBy = uid; model.CreatedDate = System.DateTime.Now; model.EmpId = Empid; objHealthService = new EmpHealthService(); objHealthService.Insert(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
public ActionResult Create() { int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); objHealthService = new EmpHealthService(); List <EmpHealthItem> listHealth = new List <EmpHealthItem>(); listHealth = objHealthService.HealthcardListData(Empid); ViewBag.Empid = Empid; EmpHealthItem objHealthitem = new EmpHealthItem(); objHealthitem.ListHealth = new List <EmpHealthItem>(); objHealthitem.ListHealth.AddRange(listHealth); //for doc listHealth = objHealthService.GetHealthDoc(Empid); objHealthitem.ListHealthDoc = new List <EmpHealthItem>(); objHealthitem.ListHealthDoc.AddRange(listHealth); listHealth = objHealthService.GetLabourDoc(Empid); objHealthitem.ListLabourDoc = new List <EmpHealthItem>(); objHealthitem.ListLabourDoc.AddRange(listHealth); listHealth = objHealthService.GetEIDDoc(Empid); objHealthitem.ListEIDDoc = new List <EmpHealthItem>(); objHealthitem.ListEIDDoc.AddRange(listHealth); List <EmpDLicenceItem> listLicence = new List <EmpDLicenceItem>(); EmpDriveLicenseService objDLicence = new EmpDriveLicenseService(); //objHealthitem.ListLicence = new List<EmpDLicenceItem>(); //objHealthitem.ListLicence.AddRange(listLicence); listLicence = objDLicence.GetLicenceDoc(Empid); objHealthitem.ListLicenceDoc = new List <EmpDLicenceItem>(); objHealthitem.ListLicenceDoc.AddRange(listLicence); ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objHealthitem)); }