public async Task <ActionResult> GetTimeslipDetail(string BillingId) { var model = new BillingModel(); if (BillingId == null || BillingId == "null" || BillingId == "undefined" || BillingId == "") { ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; string UserId = client.UserId; model.IsNew_Billable = true; model.Is_Billable = true; model.Service_By = UserId; model.Service_By_Name = client.FirstName + " " + client.LastName; model.Service_Date = DateTime.Today; return(Json(model, JsonRequestBehavior.AllowGet)); } model.IsNew_Billable = false; BillingRepo billingRepo = new BillingRepo(); model = await billingRepo.GetTeamGetBillableTimeRecord(BillingId); model.Billable = (decimal.Round(model.Billable, 2)); model.Rate = (decimal.Round(model.Rate, 2)); model.Rate_Per_Unit = (decimal.Round(model.Rate_Per_Unit, 2)); return(Json(model, JsonRequestBehavior.AllowGet)); }
public static ClaimTimer GetTimerStart() { BillingRepo repo = new BillingRepo(); ClaimTeamLoginModel client = (ClaimTeamLoginModel)HttpContext.Current.Session[SessionHelper.claimTeamLogin]; return(repo.GetTimerStart(client.UserId)); }
//Partial view //[HttpGet] public ActionResult _TimeslipDetail(string BillingId, string page) { var model = new BillingModel(); if (BillingId == null) { ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; string UserId = client.UserId; model.IsNew_Billable = true; model.Is_Billable = true; model.Service_By = UserId; model.Service_By_Name = client.FirstName + " " + client.LastName; model.Service_Date = DateTime.Today; if (!string.IsNullOrEmpty(page)) { model.PageType = page; } return(PartialView(model)); } model.IsNew_Billable = false; BillingRepo billingRepo = new BillingRepo(); model = billingRepo.GetTeamGetBillableTimeRecord(BillingId).Result; model.Billable = (decimal.Round(model.Billable, 2)); model.Rate = (decimal.Round(model.Rate, 2)); model.Rate_Per_Unit = (decimal.Round(model.Rate_Per_Unit, 2)); return(PartialView(model)); }
public async Task <ActionResult> TeamInsertTimeslip(BillingModel model) { BillingRepo billingRepo = new BillingRepo(); ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; if (model.IsNew_Billable) { var result = await billingRepo.TeamInsertTimeslip(model, client.UserId); if (result) { return(RedirectToAction("MyBillableTime")); } return(RedirectToAction("TimeslipDetail")); } else { var result = await billingRepo.TeamUpdateTimeslip(model, client.UserId); if (result) { return(RedirectToAction("MyBillableTime")); } return(RedirectToAction("TimeslipDetail")); } }
public async Task <ActionResult> TeamGetClaimActivities(string Claimsid) { List <CommonModel> list = new List <CommonModel>(); BillingRepo billingRepo = new BillingRepo(); list = await billingRepo.TeamGetClaimActivities(Claimsid); return(Json(list, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> TeamGetClaimNosAssigned(string UserId, string claimRefNumber) { List <CommonModel> list = new List <CommonModel>(); BillingRepo billingRepo = new BillingRepo(); list = await billingRepo.TeamGetClaimNosAssigned(UserId, claimRefNumber); return(Json(list, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> GetTeamGetBillableLawyers(string filter) { List <CommonModel> list = new List <CommonModel>(); BillingRepo billingRepo = new BillingRepo(); list = await billingRepo.GetTeamGetBillableLawyers(filter); return(Json(list, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> TeamGetCustomerForClaim(string Claimsid) { CommonModel list = new CommonModel(); BillingRepo billingRepo = new BillingRepo(); list = await billingRepo.TeamGetCustomerForClaim(Claimsid); return(Json(list, JsonRequestBehavior.AllowGet)); }
public void AddBillingDetailTest() { var billingrepo = new BillingRepo(billcontextmock.Object); var billingobj = billingrepo.AddBill(new ClsBill { BillId = 1, BillOwner = "abc", BillAmount = 980.8, FurnitureName = "Chair" }); Assert.IsNotNull(billingobj); }
public ActionResult InsertStartTime(string claimId) { BillingRepo repo = new BillingRepo(); var model = new ClaimTimer(); ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; string UserId = client.UserId; model.ClaimId = claimId; model.StartTime = DateTime.Now; model.UserId = UserId; repo.InsertTimerStart(model); return(Json("", JsonRequestBehavior.AllowGet)); }
public ActionResult EndTimerOnCancel(string claimId) { ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; BillingRepo billingRepo = new BillingRepo(); var lastEscapeTimer = HonanClaimsPortal.Helpers.TimerHelper.GetTimerStart(); if (lastEscapeTimer != null && lastEscapeTimer.IsTimerActive && lastEscapeTimer.ClaimId == claimId) { billingRepo.endTimerFunc(client.UserId, lastEscapeTimer.ClaimTimerId); } return(Json("TimerEnded", JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> TeamGetPolicyNoForClaim(string Claimsid) { try { List <CommonModel> list = new List <CommonModel>(); BillingRepo billingRepo = new BillingRepo(); list = await billingRepo.TeamGetPolicyNoForClaim(Claimsid); return(Json(list, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw ex; } }
public ActionResult GetTimerStart() { BillingRepo repo = new BillingRepo(); ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; ClaimTimer timer = repo.GetTimerStart(client.UserId); if (timer == null) { return(Json("notimer", JsonRequestBehavior.AllowGet)); } else { return(Json(timer, JsonRequestBehavior.AllowGet)); } }
public async Task <ActionResult> TimeslipDetail(string BillingId) { var model = new BillingModel(); if (BillingId == null) { model.IsNew_Billable = true; model.Is_Billable = true; return(View(model)); } model.IsNew_Billable = false; BillingRepo billingRepo = new BillingRepo(); model = await billingRepo.GetTeamGetBillableTimeRecord(BillingId); model.Billable = (decimal.Round(model.Billable, 2)); model.Rate = (decimal.Round(model.Rate, 2)); model.Rate_Per_Unit = (decimal.Round(model.Rate_Per_Unit, 2)); return(View(model)); }
public ActionResult NewTimeslipDetail(string BillingId, string page) { var modelOld = new BillingModel(); var model = new BillingModelNew(); if (BillingId == null) { ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; string UserId = client.UserId; model.IsNew_Billable_New = true; model.Is_Billable_New = true; model.Service_By_New = UserId; model.Service_By_Name_New = client.FirstName + " " + client.LastName; model.Service_Date_New = DateTime.Today; if (!string.IsNullOrEmpty(page)) { model.PageType_New = page; } return(PartialView(model)); } model.IsNew_Billable_New = false; BillingRepo billingRepo = new BillingRepo(); modelOld = billingRepo.GetTeamGetBillableTimeRecord(BillingId).Result; Mapper.Initialize(cfg => cfg.CreateMap <BillingModel, BillingModelNew>()); model = Mapper.Map <BillingModelNew>(modelOld); model.Billable_New = (decimal.Round(model.Billable_New, 2)); model.Rate_New = (decimal.Round(model.Rate_New, 2)); model.Rate_Per_Unit_New = (decimal.Round(model.Rate_Per_Unit_New, 2)); return(View(model)); }
public ActionResult NewTimeslipDetail(BillingModelNew model) { try { //if(model.H_Billingsid==null) //{ // return PartialView(model); //} if (model.sStart_Time_New != null) { model.Start_Time_New = Convert.ToDateTime(model.sStart_Time_New); } if (model.sEnd_Time_New != null) { model.End_Time_New = Convert.ToDateTime(model.sEnd_Time_New); } BillingRepo billingRepo = new BillingRepo(); ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; BillingModel modelOld = MapBillinOld_New(model); var result = billingRepo.TeamInsertTimeslip(modelOld, client.UserId).Result; string claimNoType = model.Claim_No_New; string redirectUrl = GetRedirectUrl(claimNoType, model.H_Claimsid_Billing_New, "billing"); return(Redirect(redirectUrl)); } catch (Exception ex) { throw ex; } }
public ActionResult _TimeslipDetail(BillingModel model) { try { //if(model.H_Billingsid==null) //{ // return PartialView(model); //} if (model.sStart_Time != null) { model.Start_Time = Convert.ToDateTime(model.sStart_Time); } if (model.sEnd_Time != null) { model.End_Time = Convert.ToDateTime(model.sEnd_Time); } BillingRepo billingRepo = new BillingRepo(); ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; if (model.IsNew_Billable) { var result = billingRepo.TeamInsertTimeslip(model, client.UserId).Result; var lastEscapeTimer = HonanClaimsPortal.Helpers.TimerHelper.GetTimerStart(); if (lastEscapeTimer != null && lastEscapeTimer.IsTimerActive && lastEscapeTimer.ClaimId == model.H_Claimsid_Billing && model.EndTimerAndSaveTimeSlip == "true") { billingRepo.endTimerFunc(client.UserId, lastEscapeTimer.ClaimTimerId); } if (model.PageType == "claimDetail") { // Session[HonanClaimsPortal.Helpers.SessionHelper.ShowTimer] = false; return(Json("success", JsonRequestBehavior.AllowGet)); //return JavaScript("location.reload(true)"); } else { //if (result) //{ // return RedirectToAction("MyBillableTime", "Billing"); //} //return RedirectToAction("MyBillableTime", "Billing"); return(JavaScript("location.reload(true)")); } } else { var result = billingRepo.TeamUpdateTimeslip(model, client.UserId).Result; if (model.PageType == "claimDetail") { return(Json("success", JsonRequestBehavior.AllowGet)); //return JavaScript("location.reload(true)"); } else { if (result) { //if (Request.IsAjaxRequest()) //return PartialView("_TimeslipDetail", model); //return View(model); //return Json(new { error = true, message = RenderViewToString(PartialView("_TimeslipDetail", model)) }); //return PartialView(model); // return RedirectToAction("MyBillableTime", "Billing"); } //return RedirectToAction("MyBillableTime", "Billing"); return(JavaScript("location.reload(true)")); } } } catch (Exception ex) { throw ex; } }