protected String GetPerDiemCount(int count, int timesheetId) { var timeBillingCityRateJoinController = new TimesheetBillingCityRateJoinController(); var perdiemCityCount = timeBillingCityRateJoinController.CityPerDiemCountGrandTotalByTimesheetId(timesheetId); return perdiemCityCount > 0 ? perdiemCityCount.ToString() : count.ToString(); }
protected String CalcTotalPerDiemCount(int count) { var timeBillingCityRateJoinController = new TimesheetBillingCityRateJoinController(); var cityCountTotal = timeBillingCityRateJoinController.CityPerDiemCountGrandTotalByTimesheetId(TimesheetID); return cityCountTotal > 0 ? cityCountTotal.ToString() : count.ToString(); }
protected String CalcTotalPerDiem(int billingRatePerDiemCount) { var timeBillingCityRateJoinController = new TimesheetBillingCityRateJoinController(); var cityPerdiemTotal = timeBillingCityRateJoinController.CityPerDiemRateGrandTotalByTimesheetId(TimesheetID); var perdiemIfNotCities = _controller.PerDiemRateByID(TimesheetID) * billingRatePerDiemCount;//no cities BillingRate Per Diem var perdiemTotalForDisplay = perdiemIfNotCities; if (cityPerdiemTotal > 0) perdiemTotalForDisplay = cityPerdiemTotal; return string.Format("{0:C}", perdiemTotalForDisplay); }
public Double GetPerDiemCountByBillingPeriodAccountID(Int32 BillingPeriodAccountID) { var timesheetBillingRateCityJoin = new TimesheetBillingCityRateJoinController(); var cityPerdiemCountTotal = 0; Double total = 0; TimesheetCollection col = this.FetchAllByPeriodAccountId(BillingPeriodAccountID); foreach (Timesheet timesheet in col) { cityPerdiemCountTotal += timesheetBillingRateCityJoin.CityPerDiemCountGrandTotalByTimesheetId(timesheet.Id); total += timesheet.Perdiemcount; } return(cityPerdiemCountTotal > 0 ? cityPerdiemCountTotal : total); }
protected void Page_Load(object sender, EventArgs e) { TimesheetId = Int32.Parse(Request.Params["id"]); var controller = new TimesheetController(); month.Value = Request.Params["month"]; year.Value = Request.Params["year"]; if (!IsPostBack) { TFS.Intranet.Data.Billing.Timesheet timesheet = new TFS.Intranet.Data.Billing.TimesheetController().FetchByID(TimesheetId)[0]; //check and see if there are any BillingCityRates for this account //var billingCityRateController = new BillingDefaultCityRateController(); //var billingCityRateCol = billingCityRateController.FetchAllActiveByAccountId(timesheet.BillingPeriodAccount.Accountid); //if (billingCityRateCol.Count > 0) //{ //} var timeBillingCityRateJoinController = new TimesheetBillingCityRateJoinController(); var cityCountPerDiem = timeBillingCityRateJoinController.CityPerDiemCountGrandTotalByTimesheetId(TimesheetId); if (cityCountPerDiem > 0) { //hide default per diem count UI element pnlDefaultPerdiemCount.Visible = false; //show city per diem UI elements pnlTimesheetBillingCityRates.Visible = true; DaysPerDiem.Text = cityCountPerDiem.ToString(); } else { DaysPerDiem.Text = timesheet.Perdiemcount.ToString(); } Mileage.Text = timesheet.Mileageclaimed.ToString(); PayRateGroup.Text = timesheet.RateGroup.Name; } }
public Double GetPerCityDiemRateAverageByBillingPeriodAccountID(Int32 BillingPeriodAccountID) { var timesheetBillingRateCityJoin = new TimesheetBillingCityRateJoinController(); var cityPerdiemRateAverageTotal = 0.00; Double total = 0; TimesheetCollection col = this.FetchAllByPeriodAccountId(BillingPeriodAccountID); foreach (Timesheet timesheet in col) { cityPerdiemRateAverageTotal += timesheetBillingRateCityJoin.CityPerDiemHourlyRateAverageByTimesheetId(timesheet.Id); } if (col.Count > 0) { cityPerdiemRateAverageTotal = cityPerdiemRateAverageTotal / col.Count; } return(cityPerdiemRateAverageTotal); }
protected String GetPerDiemRate(Double rate, int timesheetId) { var timeBillingCityRateJoinController = new TimesheetBillingCityRateJoinController(); var cityPerdiemAvg = timeBillingCityRateJoinController.CityPerDiemHourlyRateAverageByTimesheetId(timesheetId); var displayVal = cityPerdiemAvg > 0 ? cityPerdiemAvg : rate; return string.Format("{0:#.00}", displayVal); }
protected String GetPerDiemGrandTotal(int count, Double rate, int timesheetId) { var timeBillingCityRateJoinController = new TimesheetBillingCityRateJoinController(); var cityPerdiemTotal = timeBillingCityRateJoinController.CityPerDiemRateGrandTotalByTimesheetId(timesheetId); var perdiemIfNoCities = count * rate; ;//no cities BillingRate Per Diem return cityPerdiemTotal > 0 ? cityPerdiemTotal.ToString() : perdiemIfNoCities.ToString(); }
public Double GetPerDiemCountByBillingPeriodAccountID(Int32 BillingPeriodAccountID) { var timesheetBillingRateCityJoin = new TimesheetBillingCityRateJoinController(); var cityPerdiemCountTotal = 0; Double total = 0; TimesheetCollection col = this.FetchAllByPeriodAccountId(BillingPeriodAccountID); foreach (Timesheet timesheet in col) { cityPerdiemCountTotal += timesheetBillingRateCityJoin.CityPerDiemCountGrandTotalByTimesheetId(timesheet.Id); total += timesheet.Perdiemcount; } return cityPerdiemCountTotal > 0 ? cityPerdiemCountTotal : total; }
public Double GetPerCityDiemRateAverageByBillingPeriodAccountID(Int32 BillingPeriodAccountID) { var timesheetBillingRateCityJoin = new TimesheetBillingCityRateJoinController(); var cityPerdiemRateAverageTotal = 0.00; Double total = 0; TimesheetCollection col = this.FetchAllByPeriodAccountId(BillingPeriodAccountID); foreach (Timesheet timesheet in col) { cityPerdiemRateAverageTotal += timesheetBillingRateCityJoin.CityPerDiemHourlyRateAverageByTimesheetId(timesheet.Id); } if (col.Count > 0) cityPerdiemRateAverageTotal = cityPerdiemRateAverageTotal / col.Count; return cityPerdiemRateAverageTotal; }
public TimesheetBillingCityRateJoinCollection FetchAllActiveByTimesheetIdJoin(int timesheetId) { var timeSheetBillingJoinContoller = new TimesheetBillingCityRateJoinController(); return(timeSheetBillingJoinContoller.FetchActiveByTimesheetId(timesheetId)); }
public TimesheetBillingCityRateJoinCollection FetchAllActiveByTimesheetIdJoin(int timesheetId) { var timeSheetBillingJoinContoller = new TimesheetBillingCityRateJoinController(); return timeSheetBillingJoinContoller.FetchActiveByTimesheetId(timesheetId); }