public void calculationHours(double activityHours, string activityType, double productivity) { Constants c = new Constants(); estimatedDuration ed = new estimatedDuration(); ed.name = activityType; ed.type = c.barChart.ToString(); if (activityHours >= productivity) { if (usedHours != 0) { if (activityType == "SQL") { sqlinput.Add(Convert.ToInt32(balanceHourss)); } } } }
public void calculateDuration(double activityHours, string activityType, double productitvity) { Constants c = new Constants(); estimatedDuration ed = new estimatedDuration(); ed.name = activityType.ToString(); ed.type = c.barChart.ToString(); if (productitvity > balanceHours) { if (activityType == c.UIHOURS.ToString()) { uiinput.Add(balanceHours); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.BackendHOURS.ToString()) { backendinput.Add(balanceHours); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.UnittestingHOURS.ToString()) { unittestinput.Add(balanceHours); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.TechnicaltestingHOURS.ToString()) { techtestinput.Add(balanceHours); bugfixinput.Add(0); } else if (activityType == c.BugfixingHOURS.ToString()) { bugfixinput.Add(balanceHours); } } int days = Convert.ToInt32(Math.Floor(activityHours / productitvity)); balanceHours = Convert.ToInt32(activityHours % productitvity); //balanceHours = Convert.ToInt32(productitvity - ) for (int i = 1; i <= days; i++) { if (activityType == c.SQLHOURS.ToString()) { sqlinput.Add(productitvity); uiinput.Add(0); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.UIHOURS.ToString()) { uiinput.Add(productitvity); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.BackendHOURS.ToString()) { backendinput.Add(productitvity); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.UnittestingHOURS.ToString()) { unittestinput.Add(productitvity); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.TechnicaltestingHOURS.ToString()) { techtestinput.Add(productitvity); bugfixinput.Add(0); } else if (activityType == c.BugfixingHOURS.ToString()) { bugfixinput.Add(productitvity); } } if (activityType == c.SQLHOURS.ToString()) { sqlinput.Add(balanceHours); ed.data = sqlinput; lstED.Add(ed); } else if (activityType == c.UIHOURS.ToString()) { int total = Convert.ToInt32(activityHours - uiinput.Sum()); uiinput.Add(total); balanceHours = Convert.ToInt32(productitvity - total); ed.data = uiinput; lstED.Add(ed); } else if (activityType == c.BackendHOURS.ToString()) { int total = Convert.ToInt32(activityHours - backendinput.Sum()); backendinput.Add(total); balanceHours = Convert.ToInt32(productitvity - total); ed.data = backendinput; lstED.Add(ed); } else if (activityType == c.UnittestingHOURS.ToString()) { int total = Convert.ToInt32(activityHours - unittestinput.Sum()); unittestinput.Add(total); balanceHours = Convert.ToInt32(productitvity - total); ed.data = unittestinput; lstED.Add(ed); } else if (activityType == c.TechnicaltestingHOURS.ToString()) { int total = Convert.ToInt32(activityHours - techtestinput.Sum()); techtestinput.Add(total); balanceHours = Convert.ToInt32(productitvity - total); ed.data = techtestinput; lstED.Add(ed); } else if (activityType == c.BugfixingHOURS.ToString()) { int total = Convert.ToInt32(activityHours - bugfixinput.Sum()); bugfixinput.Add(total); balanceHours = Convert.ToInt32(productitvity - total); ed.data = bugfixinput; lstED.Add(ed); } //balanceHours = Convert.ToInt32(productitvity - balanceHours); }
public void calculationHours1(double activityHours, string activityType, double productivity) { Constants c = new Constants(); estimatedDuration ed = new estimatedDuration(); ed.name = activityType; ed.type = c.barChart.ToString(); if (activityHours >= productivity) { if (usedHours != 0) { if (activityType == c.SQLHOURS.ToString()) { sqlinput.Add(productivity - usedHours); activityHours = activityHours - (productivity - usedHours); uiinput.Add(0); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } if (activityType == c.UIHOURS.ToString()) { sqlinput.Add(0); uiinput.Add(productivity - usedHours); activityHours = activityHours - (productivity - usedHours); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } if (activityType == c.BackendHOURS.ToString()) { sqlinput.Add(0); uiinput.Add(0); backendinput.Add(productivity - usedHours); activityHours = activityHours - (productivity - usedHours); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } if (activityType == c.UnittestingHOURS.ToString()) { sqlinput.Add(0); uiinput.Add(0); backendinput.Add(0); unittestinput.Add(productivity - usedHours); activityHours = activityHours - (productivity - usedHours); techtestinput.Add(0); bugfixinput.Add(0); } if (activityType == c.TechnicaltestingHOURS.ToString()) { sqlinput.Add(0); uiinput.Add(0); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(productivity - usedHours); activityHours = activityHours - (productivity - usedHours); bugfixinput.Add(0); } if (activityType == c.BugfixingHOURS.ToString()) { sqlinput.Add(0); uiinput.Add(0); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(productivity - usedHours); activityHours = activityHours - (productivity - usedHours); } } } if (activityHours >= productivity) { int days = Convert.ToInt32(Math.Floor(activityHours / productivity)); int balanceHours = Convert.ToInt32(activityHours % productivity); for (int i = 1; i <= days; i++) { if (activityType == c.SQLHOURS.ToString()) { sqlinput.Add(productivity); uiinput.Add(0); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.UIHOURS.ToString()) { //if (usedHours != 0) { uiinput.Add(productivity - usedHours); } uiinput.Add(productivity); backendinput.Add(0); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.BackendHOURS.ToString()) { //if (usedHours != 0) { backendinput.Add(productivity - usedHours); } backendinput.Add(productivity); unittestinput.Add(0); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.UnittestingHOURS.ToString()) { //if (usedHours != 0) { unittestinput.Add(productivity - usedHours); } unittestinput.Add(productivity); techtestinput.Add(0); bugfixinput.Add(0); } else if (activityType == c.TechnicaltestingHOURS.ToString()) { //if (usedHours != 0) { techtestinput.Add(productivity - usedHours); } techtestinput.Add(productivity); bugfixinput.Add(0); } else if (activityType == c.BugfixingHOURS.ToString()) { //if (usedHours != 0) { bugfixinput.Add(productivity - usedHours); } bugfixinput.Add(productivity); } } if (activityType == c.sqlHours.ToString()) { usedHours = Convert.ToInt32(activityHours - sqlinput.Sum()); sqlinput.Add(usedHours); } if (activityType == c.UIHOURS.ToString()) { usedHours = Convert.ToInt32(activityHours - uiinput.Sum()); uiinput.Add(usedHours); } if (activityType == c.BackendHOURS.ToString()) { usedHours = Convert.ToInt32(activityHours - backendinput.Sum()); backendinput.Add(usedHours); } if (activityType == c.UnittestingHOURS.ToString()) { usedHours = Convert.ToInt32(activityHours - unittestinput.Sum()); unittestinput.Add(usedHours); } if (activityType == c.TechnicaltestingHOURS.ToString()) { usedHours = Convert.ToInt32(activityHours - techtestinput.Sum()); techtestinput.Add(usedHours); } if (activityType == c.BugfixingHOURS.ToString()) { usedHours = Convert.ToInt32(activityHours - bugfixinput.Sum()); bugfixinput.Add(usedHours); } } else { int balanceHours = Convert.ToInt32(activityHours % productivity); if (activityType == c.SQLHOURS.ToString()) { sqlinput.Add(balanceHours); usedHours = balanceHours; } if (activityType == c.UIHOURS.ToString()) { uiinput.Add(balanceHours); usedHours = balanceHours; } if (activityType == c.BackendHOURS.ToString()) { backendinput.Add(balanceHours); usedHours = balanceHours; } if (activityType == c.UnittestingHOURS.ToString()) { unittestinput.Add(balanceHours); usedHours = balanceHours; } if (activityType == c.TechnicaltestingHOURS.ToString()) { techtestinput.Add(balanceHours); usedHours = balanceHours; } if (activityType == c.BugfixingHOURS.ToString()) { bugfixinput.Add(balanceHours); usedHours = balanceHours; } } if (activityType == c.SQLHOURS.ToString()) { ed.data = sqlinput; lstED.Add(ed); } if (activityType == c.UIHOURS.ToString()) { ed.data = uiinput; lstED.Add(ed); } if (activityType == c.BackendHOURS.ToString()) { ed.data = backendinput; lstED.Add(ed); } if (activityType == c.UnittestingHOURS.ToString()) { ed.data = unittestinput; lstED.Add(ed); } if (activityType == c.TechnicaltestingHOURS.ToString()) { ed.data = techtestinput; lstED.Add(ed); } if (activityType == c.BugfixingHOURS.ToString()) { ed.data = sqlinput; lstED.Add(ed); } }