private string getOnTrackAmount(Goal g, GoalReportModel grm) { string ontrack_amt; var real_amt = (decimal)0.00; var targetweeklyamount = (decimal)0.00; var currentweekamount = grm.Amount; var baselineweekamt = grm.BaselineWeekAmt; if (g.GoalMode == 0) { // Use Target percentage targetweeklyamount = baselineweekamt - (baselineweekamt * g.TargetPercentage / 100); } real_amt = (targetweeklyamount - currentweekamount); var color = getOnTrackColor(real_amt); real_amt = real_amt < 0 ? real_amt * -1 : real_amt; if (g.GoalType == 0) { // Dollars ontrack_amt = "$ " + real_amt.ToString("####0.00"); } else { ontrack_amt = real_amt.ToString("####0.00") + " lb."; } return(currentweekamount == 0 ? "" : string.Format("{0}", ontrack_amt)); //return currentweekamount == 0 ? "" : string.Format("<div'><font color='{0}'>{1}</font></div>", color, ontrack_amt); }
private void bGoalProgress_Click(object sender, EventArgs e) { if (CurrGoal.StartDate >= DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek)) { // Current Date can't be before the start date MessageBox.Show("Current selected week must be after the start date!"); return; } int daysworking = 0; decimal percentcomplete = (decimal)0.0; decimal baselineweekamt = (decimal)0.0; decimal targetweeklyamount = CurrGoal.TargetAmount; decimal currentweekamount = 0; string dollarsign = "$ "; string lbstring = " lb"; GoalReportModel grm = GoalsDAO.DAO.getAmount(CurrGoal, DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek)); percentcomplete = grm.PercentComplete; baselineweekamt = grm.BaselineWeekAmt; currentweekamount = grm.Amount; daysworking = grm.DaysWorking;; if (CurrGoal.GoalMode == 0) { // Use Target percentage targetweeklyamount = baselineweekamt - (baselineweekamt * CurrGoal.TargetPercentage / 100); } string cw_amt = string.Empty; string bw_amt = string.Empty; string tar_amt = string.Empty; if (CurrGoal.GoalType == 0) { // Dollars bw_amt = "$ " + baselineweekamt.ToString("#####0.00"); cw_amt = "$ " + currentweekamount.ToString("#####0.00"); tar_amt = "$ " + targetweeklyamount.ToString("#####0.00"); lbstring = ""; } else { bw_amt = baselineweekamt.ToString("#####0.00") + " lb."; cw_amt = currentweekamount.ToString("#####0.00") + " lb."; tar_amt = targetweeklyamount.ToString("#####0.00") + " lb."; dollarsign = ""; } MessageBox.Show("Goal ( " + CurrGoal.GoalName + "):\n\n" + "Baseline Week: " + CurrGoal.StartDate.AddDays(-7).ToShortDateString() + "\n Baseline Week Amount: " + bw_amt + "\n Target Amount: " + tar_amt + "\n\n" + "Goal Start Date: " + CurrGoal.StartDate.ToShortDateString() + "\n\n Current Week: " + DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek).ToShortDateString() + "\n Current Week Amount: " + cw_amt + "\n Percent Complete: " + (percentcomplete * 100).ToString("##0.0") + " %" + "\n Days Working: " + daysworking.ToString() + "\n Gap to Goal: " + dollarsign + grm.GaptoGoal.ToString("#####0.00") + lbstring); }
private string getData(GoalReportModel g, string reportMode) { switch (reportMode) { case "0": return(string.Format("{0}", Math.Round(g.PercentComplete, 0) * 100)); case "1": return(g.DaysWorking.ToString()); case "2": break; } return(string.Empty); }
private string getActualAmount(Goal g, GoalReportModel grm) { string cw_amt; var currentweekamount = grm.Amount; if (g.GoalType == 0) { // Dollars cw_amt = currentweekamount.ToString("#####0.00"); } else { cw_amt = currentweekamount.ToString("#####0.00"); } return(currentweekamount == 0 ? "" : cw_amt); }
private string getOnTrackAmount(Goal g, GoalReportModel grm) { string ontrack_amt; var real_amt = (decimal)0.00; var targetweeklyamount = (decimal)0.00; var currentweekamount = grm.Amount; var baselineweekamt = grm.BaselineWeekAmt; if (g.GoalMode == 0) { // Use Target percentage targetweeklyamount = baselineweekamt - (baselineweekamt * g.TargetPercentage / 100); } real_amt = (targetweeklyamount - currentweekamount); real_amt = real_amt < 0 ? real_amt * -1 : real_amt; return(currentweekamount == 0 ? "0" : string.Format("{0}", real_amt)); }
private string getOnTrackBackgroundColor(Goal g, GoalReportModel grm) { string ontrack_amt; var real_amt = (decimal)0.00; var targetweeklyamount = (decimal)0.00; var currentweekamount = grm.Amount; var baselineweekamt = grm.BaselineWeekAmt; if (g.GoalMode == 0) { // Use Target percentage targetweeklyamount = baselineweekamt - (baselineweekamt * g.TargetPercentage / 100); } real_amt = (targetweeklyamount - currentweekamount); var color = getOnTrackColor(real_amt); return(grm.Amount > (decimal)0.00 ? color : ""); }
private decimal getTargetAmount(Goal g, GoalReportModel grm) { string cw_amt = string.Empty; string bw_amt = string.Empty; string tar_amt = string.Empty; var currentweekamount = grm.Amount; var baselineweekamt = grm.BaselineWeekAmt; var targetweeklyamount = baselineweekamt - g.TargetAmount; if (g.GoalMode == 0) { // Use Target percentage targetweeklyamount = baselineweekamt - (baselineweekamt * g.TargetPercentage / 100); } else { var weeks = Math.Round((decimal)(g.TargetDate.Subtract(g.StartDate).Days) / 7); targetweeklyamount = Math.Round((baselineweekamt - g.TargetAmount) / weeks, 0); } return(targetweeklyamount); }
private string getSymbol(Goal g, GoalReportModel grm) { return(grm.Amount > (decimal)0.00 ? "◊" : ""); }