public async Task <IActionResult> Edit(int id, [Bind("Id,Companyid,Planid,Planfriendlyname,AnnualPremium,Discountlump,Discountperenrollee,Createdby,Description,AuthorizationStatus,AuthorizationNote,AllowChildEnrollee,DisapprovalNote,AuthorizedBy,DisapprovedBy,AuthorizedDate,DisapprovalDate,Status,Guid,CreatedOn,UpdatedOn,IsDeleted,SiteId,MaxNoOfDependant,ProviderConsession")] CompanyPlan companyPlan) { if (id != companyPlan.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(companyPlan); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyPlanExists(companyPlan.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(companyPlan)); }
public async Task <IActionResult> Create([Bind("Id,Companyid,Planid,Planfriendlyname,AnnualPremium,Discountlump,Discountperenrollee,Createdby,Description,AuthorizationStatus,AuthorizationNote,AllowChildEnrollee,DisapprovalNote,AuthorizedBy,DisapprovedBy,AuthorizedDate,DisapprovalDate,Status,Guid,CreatedOn,UpdatedOn,IsDeleted,SiteId,MaxNoOfDependant,ProviderConsession")] CompanyPlan companyPlan) { if (ModelState.IsValid) { _context.Add(companyPlan); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(companyPlan)); }
public long GetNumberofAdmission(DateTime start, DateTime End, ref Dictionary <int, int> theplan) { IQueryOver <AuthorizationCode, AuthorizationCode> query = _session.QueryOver <AuthorizationCode>().Where(x => x.IsDeleted == false && x.Isadmission == true); IList <Plan> genericlist = _session.QueryOver <Plan>().Where(x => x.IsDeleted == false).List(); //var placount = new Dictionary<int, int>(); foreach (Plan item in genericlist) { theplan.Add(item.Id, 0); } if (true) { DateTime datete = Convert.ToDateTime(End); int dd = datete.Day; int month = datete.Month; int year = datete.Year; string time = "23:59"; DateTime enddate = Convert.ToDateTime(string.Format("{0}/{1}/{2} {3}", month, dd, year, time)); query.Where(Restrictions.On <AuthorizationCode>(a => a.AdmissionDate).IsBetween(start).And(enddate)); } //added else else { } IList <AuthorizationCode> totaladd = query.List(); foreach (AuthorizationCode item in totaladd) { Enrollee enrollee = _session.QueryOver <Enrollee>().Where(x => x.IsDeleted == false && x.Id == item.enrolleeID).SingleOrDefault(); if (enrollee != null) { Staff staff = _session.QueryOver <Staff>().Where(x => x.Id == enrollee.Staffprofileid).SingleOrDefault(); if (staff != null) { CompanyPlan plan = _session.QueryOver <CompanyPlan>().Where(x => x.Id == staff.StaffPlanid).SingleOrDefault(); if (plan != null) { int count = theplan[plan.Planid]; count++; theplan[plan.Planid] = count; } else { } } else { } } //added else else { } } return(query.RowCount()); }