Beispiel #1
0
        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));
        }
Beispiel #2
0
        //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));
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        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));
        }