public ActionResult GetData() { int Excellent = db.Feedback.Where(x => x.Answer == "Excellent").Count(); int Good = db.Feedback.Where(x => x.Answer == "Good").Count(); int Neutral = db.Feedback.Where(x => x.Answer == "Neutral").Count(); int Poor = db.Feedback.Where(x => x.Answer == "Poor").Count(); ratio obj = new ratio(); obj.Excellent = Excellent; obj.Good = Good; obj.Neutral = Neutral; obj.Poor = Poor; return(Json(obj, JsonRequestBehavior.AllowGet)); }
public ActionResult getdata() { User UserExpirienceYears = db.users.Where(x => x.UserId == 2).Single(); List <string> obj = new List <string>(); int UserExpirienceYear = UserExpirienceYears.UserExpirienceYears; int nump = UserExpirienceYears.NumOFProject; ratio r = new ratio(); r.UserExpirienceYears = UserExpirienceYear; // r.Qualifications = UserExpirienceYears.Qualifications; r.numOfProjects = UserExpirienceYears.NumOFProject; ViewBag.data = r; ViewBag.num = UserExpirienceYears.NumOFProject; ViewBag.ex = UserExpirienceYears.UserExpirienceYears; return(Json(r, JsonRequestBehavior.AllowGet)); }
public ActionResult Highchats() { DateTime nowdate = DateTime.Now; int sport = db.tActivity.Where(x => x.fActLabelId == 5 && string.Compare(x.fActivityDate, "2020/09/01") >= 0 && string.Compare(x.fActivityDate, "2020/09/30") <= 0).Count(); int market = db.tActivity.Where(x => x.fActLabelId == 4 && string.Compare(x.fActivityDate, "2020/09/01") >= 0 && string.Compare(x.fActivityDate, "2020/09/30") <= 0).Count(); int teach = db.tActivity.Where(x => x.fActLabelId == 3 && string.Compare(x.fActivityDate, "2020/09/01") >= 0 && string.Compare(x.fActivityDate, "2020/09/30") <= 0).Count(); int clean = db.tActivity.Where(x => x.fActLabelId == 2 && string.Compare(x.fActivityDate, "2020/09/01") >= 0 && string.Compare(x.fActivityDate, "2020/09/30") <= 0).Count(); int internetact = db.tActivity.Where(x => x.fActLabelId == 6 && string.Compare(x.fActivityDate, "2020/09/01") >= 0 && string.Compare(x.fActivityDate, "2020/09/30") <= 0).Count(); int freeact = db.tActivity.Where(x => x.fActLabelId == 1 && string.Compare(x.fActivityDate, "2020/09/01") >= 0 && string.Compare(x.fActivityDate, "2020/09/30") <= 0).Count(); ratio obj = new ratio(); obj.Sport = sport; obj.Market = market; obj.Clean = clean; obj.Interentact = internetact; obj.Freeact = freeact; obj.Teach = teach; return(Json(obj, JsonRequestBehavior.AllowGet)); }
//piechart actions public ActionResult Getdata(int?year, int[] month, long country = 0) { long id = (long)Session["userid"]; var values = Request.Form["month"]; string countries = string.Empty; // Initialize a string to hold the comma-delimited data as empty if (country != 0) { countries = "" + country + ""; } else { bindState(); IEnumerable <SelectListItem> count = (IEnumerable <SelectListItem>)TempData["country"]; foreach (var item in count) { if (countries.Length > 0) { countries += ","; // Add a comma if data already exists } countries += "" + item.Value + ""; } } string mymonths = string.Empty; if (month[0] == 0) { if (year == 2018) { for (int i = 1; i <= DateTime.Now.Month; i++) { if (mymonths.Length > 0) { mymonths += ","; // Add a comma if data already exists } mymonths += "" + DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(i) + ""; } } else { mymonths += "" + "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" + ""; } } else { foreach (var item in month) { if (mymonths.Length > 0) { mymonths += ","; // Add a comma if data already exists } mymonths += "" + DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(item) + ""; } } short?years = (short?)year; var value = db.TimeSheetPieChartForApplicationDashboard(id, countries, years, mymonths).FirstOrDefault(); long Submitted = value.Submitted; long Received = value.Received; long Rejected = value.Rejected; long Approved = value.Approved; int? MissingTScount = value.MissingTScount; ratio obj = new ratio(); obj.admin = Submitted; obj.Finance = Received; obj.sales = Rejected; obj.delivery = Approved; obj.superuser = MissingTScount; return(Json(obj, JsonRequestBehavior.AllowGet)); }
public ActionResult Getdata(long[] cid, long coid, int?year, int[] month, int lob = 0) { if (Session["userid"] == null) { return(RedirectToAction("Login", "Account")); } long id = (long)Session["userid"]; string mymonths = string.Empty; if (month[0] == 0) { if (year == 2018) { for (int i = 1; i <= DateTime.Now.Month; i++) { if (mymonths.Length > 0) { mymonths += ","; // Add a comma if data already exists } mymonths += "" + DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(i) + ""; } } else { mymonths += "" + "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" + ""; } } else { foreach (var item in month) { if (mymonths.Length > 0) { mymonths += ","; // Add a comma if data already exists } mymonths += "" + DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(item) + ""; } } short? years = (short?)year; string lobdata = string.Empty; string clientdata = string.Empty; if (lob == 0) { } else { lobdata = "" + lob + ""; } if (cid[0] == 0) { getClient(coid, cid); foreach (var item in ViewBag.clients) { if (clientdata.Length > 0) { clientdata += ","; // Add a comma if data already exists } clientdata += "" + item.Value + ""; } } else { foreach (var item in cid) { if (clientdata.Length > 0) { clientdata += ","; // Add a comma if data already exists } clientdata += "" + item + ""; } } var value = db.TimeSheetPieChartForAppClientPage(years, mymonths, clientdata, lobdata).FirstOrDefault(); long Submitted = value.Submitted; long Received = value.Received; long Rejected = value.Rejected_TimeSheet; long Approved = value.Approved; int? MissingTScount = value.MissingTScount; ratio obj = new ratio(); obj.admin = Submitted; obj.Finance = Received; obj.sales = Rejected; obj.delivery = Approved; obj.superuser = MissingTScount; return(Json(obj, JsonRequestBehavior.AllowGet)); }