public ActionResult cbpview(string restcode) { try { //string DeliverTime; if (restcode == null) { restcode = "HN"; } DeliverTime = DateTime.Today.ToString(); Ankapurservices chartl = new Ankapurservices(); var modelCust2 = chartl.chartbar(DeliverTime, restcode); //ViewBag.time = modelCust.Select(m => Convert.ToDateTime(m.OrderDate).ToString("yyyy-MM-dd")).ToList(); var data = String.Join(",", modelCust2.Select(m => Convert.ToDateTime(m.month).ToString("MMMM-yyyy")).ToList()); //ViewBag.time = String.Join(",", modelCust.Select(m => Convert.ToDateTime(m.OrderDate).ToString("MMM dd")).ToList()); //var date1 = data.Split(','); var result = string.Join(",", data); ViewBag.time2 = result; ViewBag.orders2 = String.Join(",", modelCust2.Select(m => m.count).ToList()); return(PartialView("cbpview", modelCust2)); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", "graph") + "'</script>")); } }
public ActionResult downloadmonth(DateTime DeliverTime, string restcode) { if (DeliverTime != null) { //ViewBag.Message = "Your application description page."; Ankapurservices objCrd = new Ankapurservices(); var modelCust1 = objCrd.monthlyreports(DeliverTime, restcode); var gv = new GridView(); gv.DataSource = modelCust1; gv.DataBind(); Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment; filename=ankapurchickenmonthly.xls"); Response.ContentType = "application/ms-excel"; Response.Charset = ""; StringWriter objStringWriter = new StringWriter(); HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter); gv.RenderControl(objHtmlTextWriter); Response.Output.Write(objStringWriter.ToString()); Response.Flush(); Response.End(); return(View("Index")); } return(Content("<script> alert('please select date')</script>")); }
public ActionResult customerpview1(string phoneno, string restcode) { if (phoneno != null) { var p2 = "0"; Ankapurservices objCrd = new Ankapurservices(); var od = objCrd.custreports(phoneno, restcode); ViewBag.orders = od.Count; ViewBag.phoneno = phoneno; foreach (var item in od) { string amount = item.amountPaid; if (amount == null || amount == "") { amount = "0"; } PriceSum = PriceSum + decimal.Parse(amount); p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum)); } ViewBag.Totalamount = p2; var od1 = objCrd.custdiscounts(phoneno, restcode).FirstOrDefault(); var disc = (od1 != null) ? od1.Discount : "0"; ViewBag.discount = disc; return(PartialView("customerpview1")); //return View(); //return Content("<script> alert(phoneno); </script>"); } return(PartialView("customerpview1", null)); }
public ActionResult OrderDetails(string orderid, string restcode) { if (orderid != null) { if (restcode == null | restcode == "") { restcode = "HN"; } Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.orderdetails(orderid, restcode); //foreach (var item in modelCust) //{ // string Price = item.Price; // string Quantity = item.Quantity; // string ProductName = item.ProductName; //} ViewBag.check = "Y"; ViewBag.data = modelCust.ToList(); return(PartialView("OrderDetails")); } ViewBag.check = "N"; return(PartialView("OrderDetails", null)); }
//excel download public ActionResult downloadmonthly(string DeliverTime, string restcode) { if (DeliverTime != null) { var today = Convert.ToDateTime(DeliverTime); string DeliverTime2 = Convert.ToDateTime(today).ToString("yyyy-MM"); string DeliverTime1 = Convert.ToDateTime(DeliverTime).ToString("MMMM-yyyy"); string[] nameParts = DeliverTime2.Split('-'); string year = nameParts[0]; string month = nameParts[1]; Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.monthlyreportsk(year, month, restcode); var gv = new GridView(); gv.DataSource = modelCust; gv.DataBind(); Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment; filename=ankapurchickenmonthly.xls"); Response.ContentType = "application/ms-excel"; Response.Charset = ""; StringWriter objStringWriter = new StringWriter(); HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter); gv.RenderControl(objHtmlTextWriter); Response.Output.Write(objStringWriter.ToString()); Response.Flush(); Response.End(); return(RedirectToAction("Index", "dailyReport")); } return(Content("<script> alert('please select date')</script>")); }
public ActionResult nextmonth(DateTime DeliverTime, string restcode) { DateTime DeliverTime1 = DeliverTime.AddDays(1); DateTime DeliverTime2 = DeliverTime.AddDays(32); //string DeliverTime1 = dateTime.AddDays(-15).ToString("dd/MM/yyyy"); Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.monthlyreports(DeliverTime2, restcode); foreach (var item in modelCust) { string amount = item.amountPaid; string total = item.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = item.cgstcharges; string sgst = item.sgstcharges; string deliverycharges = item.Deliverycharges; string status = item.status; string tip = item.Tip; string disco = item.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue2 = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum2 = PriceSum2 + decimal.Parse(amount); } } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue2)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum2)); //PriceSum1 += item.amountPaid; // instead of =+ ViewBag.Pricesum = p2; ViewBag.revenue = r2; ViewBag.modelCust = modelCust.Count; ViewBag.selectdate1 = DeliverTime1.ToString("dd/MM/yyyy"); ViewBag.selectdate = DeliverTime2.ToString("dd/MM/yyyy"); ViewBag.selectdate2 = DeliverTime2.ToString("yyyy/MM/dd").Replace('-', '/'); if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; ViewBag.restcode = restcode; return(View(modelCust)); }
public PartialViewResult dailytable(string DeliverTime) { DeliverTime = DateTime.Today.ToString(); Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.Getdailyreports(DeliverTime); return(PartialView("dailytable", modelCust)); }
public PartialViewResult dailytable(string restcode) { if (restcode == null) { restcode = "HN"; } DateTime DeliverTime = DateTime.Today; Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.Getdailyreports(DeliverTime, restcode); foreach (var reports in modelCust) { string amount = reports.amountPaid; string total = reports.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = reports.cgstcharges; string sgst = reports.sgstcharges; string deliverycharges = reports.Deliverycharges; string status = reports.status; string tip = reports.Tip; string disco = reports.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue2 = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum2 = PriceSum2 + decimal.Parse(amount); } } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue2)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum2)); //PriceSum1 += item.amountPaid; // instead of =+ ViewBag.modelCust = modelCust.Count; ViewBag.Pricesum = p2; ViewBag.revenue = r2; ViewBag.selectdate = DateTime.Now.ToString("dd/MM/yyyy").Replace('-', '/'); ViewBag.selectdate1 = DateTime.Now.ToString("MM/dd/yyyy").Replace('-', '/'); return(PartialView("dailytable", modelCust)); }
public ActionResult chpie2view(string restcode) { try { if (restcode == null) { restcode = "HN"; } DeliverTime = DateTime.Today.ToString(); Ankapurservices chartl = new Ankapurservices(); var modelCust1 = chartl.chartpie(DeliverTime, restcode); ViewBag.ordertype = String.Join(",", modelCust1.Select(m => m.Ordertype).ToList()); ViewBag.orders1 = String.Join(",", modelCust1.Select(m => m.Orders).ToList()); return(PartialView("chpie2view", modelCust1)); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", "graph") + "'</script>")); } }
public ActionResult downloadrange(string DeliverTime, string DeliverTime1, string restcode) { if (DeliverTime == null) { return(Content("<script language='javascript' type='text/javascript'>alert('Select date');location.href='" + @Url.Action("Index", "range") + "'</script>")); } if (DeliverTime1 == null) { return(Content("<script language='javascript' type='text/javascript'>alert('Select date');location.href='" + @Url.Action("Index", "range") + "'</script>")); } if (restcode == null) { return(Content("<script language='javascript' type='text/javascript'>alert('Select restaurant');location.href='" + @Url.Action("Index", "range") + "'</script>")); } if (DeliverTime != null && DeliverTime1 != null && restcode != null) { //ViewBag.Message = "Your application description page."; Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.rangereports(DeliverTime, DeliverTime1, restcode); var gv = new System.Web.UI.WebControls.GridView(); gv.DataSource = modelCust; gv.DataBind(); Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment; filename=ankapurchickenrange.xls"); Response.ContentType = "application/ms-excel"; Response.Charset = ""; StringWriter objStringWriter = new StringWriter(); HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter); gv.RenderControl(objHtmlTextWriter); Response.Output.Write(objStringWriter.ToString()); Response.Flush(); Response.End(); return(RedirectToAction("Index", "dailyReport")); } return(Content("<script> alert('please select date')</script>")); }
//public PartialViewResult customerpview(string DeliverTime) //{ // if (DeliverTime != null) // { // List<customerviewmodel> allOrder = new List<customerviewmodel>(); // Ankapurservices objCrd = new Ankapurservices(); // var modelCust = objCrd.customerdetails(DeliverTime); // //ViewBag.orderhistory = Odtails(); // foreach (var i in modelCust) // { // string phoneno = i.phoneNo; // var od = objCrd.custreports(phoneno).ToList();; // allOrder.Add(new customerviewmodel { custDetails = i, orderDetails = od }); // ViewBag.custdetails = modelCust; // ViewBag.orderdetails = od; // } // return PartialView("customerpview", allOrder); // // return PartialView("customerpview"); // } // return PartialView("customerpview", null); //} public PartialViewResult customerpview(string DeliverTime, string restcode) { try { if (DeliverTime != null) { List <customerviewmodel> allOrder = new List <customerviewmodel>(); Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.customerdetails(DeliverTime, restcode); //ViewBag.orderhistory = Odtails(); ViewBag.restcode = restcode; return(PartialView("customerpview", modelCust)); // return PartialView("customerpview"); } return(PartialView("customerpview", null)); } catch (Exception ex) { throw ex; } }
public ActionResult clpview(string restcode) { try { //string DeliverTime; if (restcode == null) { restcode = "HN"; } DeliverTime = DateTime.Today.ToString(); Ankapurservices chartl = new Ankapurservices(); var modelCust = chartl.chartline(DeliverTime, restcode); var data = String.Join(",", modelCust.OrderByDescending(m => m.OrderDate).Select(m => Convert.ToDateTime(m.OrderDate).ToString("dd-MM-yyyy")).ToList()); ViewBag.time = data; ViewBag.orders = String.Join(",", modelCust.OrderByDescending(m => m.OrderDate).Select(m => m.Orders).ToList()); return(PartialView("clpview", modelCust)); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", "graph") + "'</script>")); } }
public ActionResult monthlyreport(string DeliverTime, string restcode) { if (DeliverTime != null) { try { string DeliverTime1 = Convert.ToDateTime(DeliverTime).ToString("MMMM-yyyy"); string[] nameParts = DeliverTime.Split('-'); string year = nameParts[0]; string month = nameParts[1]; Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.monthlyreportsk(year, month, restcode); foreach (var reports in modelCust) { string amount = reports.amountPaid; string total = reports.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = reports.cgstcharges; string sgst = reports.sgstcharges; string deliverycharges = reports.Deliverycharges; string status = reports.status; string tip = reports.Tip; string disco = reports.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum = PriceSum + decimal.Parse(amount); } } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum)); //string r2 = String.Format("{0:n0}", Convert.ToDouble(revenue)); //string p2 = String.Format("{0:n0}", Convert.ToDouble(PriceSum)); ViewBag.revenue = r2; ViewBag.Pricesum = p2; ViewBag.modelCust = modelCust.Count; ViewBag.month = DeliverTime1; ViewBag.restcode = restcode; if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; return(PartialView("monthlyreports", modelCust)); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", " monthly") + "'</script>")); } } return(PartialView("monthlyreports", null)); }
public ActionResult nextmonth(string DeliverTime, string restcode) { var today = Convert.ToDateTime(DeliverTime); DateTime lastmonth; if (today.Month != 12) { lastmonth = new DateTime(today.Year, today.Month + 1, 1); } else { lastmonth = new DateTime(today.Year + 1, today.Month - 11, 1); } string DeliverTime1 = Convert.ToDateTime(lastmonth).ToString("MMMM-yyyy"); string DeliverTime2 = Convert.ToDateTime(lastmonth).ToString("MM-yyyy"); string[] nameParts = DeliverTime2.Split('-'); string month = nameParts[0]; string year = nameParts[1]; Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.monthlyreportsk(year, month, restcode); foreach (var item in modelCust) { string amount = item.amountPaid; string total = item.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = item.cgstcharges; string sgst = item.sgstcharges; string deliverycharges = item.Deliverycharges; string status = item.status; string tip = item.Tip; string disco = item.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum = PriceSum + decimal.Parse(amount); } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum)); //PriceSum1 += item.amountPaid; // instead of =+ ViewBag.Pricesum = p2; ViewBag.revenue = r2; } ViewBag.modelCust = modelCust.Count; ViewBag.month = DeliverTime1; ViewBag.restcode = restcode; if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; return(View(modelCust)); }
public ActionResult weekpview(string restcode) { if (restcode == null) { restcode = "HN"; } DateTime DeliverTime = DateTime.Today; Ankapurservices objCrd = new Ankapurservices(); DateTime dateTime = Convert.ToDateTime(DeliverTime, new CultureInfo("en-GB")); var modelCust2 = objCrd.Weeklyreports(DeliverTime, restcode); string DeliverTime1 = dateTime.AddDays(-7).ToString("dd/MM/yyyy"); foreach (var reports in modelCust2) { string amount = reports.amountPaid; string total = reports.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = reports.cgstcharges; string sgst = reports.sgstcharges; string deliverycharges = reports.Deliverycharges; string status = reports.status; string tip = reports.Tip; string disco = reports.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue1 = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum1 = PriceSum1 + decimal.Parse(amount); } } var r1 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue1)); var p1 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum1)); //PriceSum1 += item.amountPaid; // instead of =+ ViewBag.modelCust2 = modelCust2.Count; ViewBag.Pricesum1 = p1; ViewBag.revenue1 = r1; ViewBag.selectdate = DateTime.Now.ToString("dd/MM/yyyy").Replace('-', '/'); ViewBag.selectdate1 = DeliverTime1; if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; ViewBag.restcode = restcode; return(PartialView("weekpview", modelCust2)); }
public PartialViewResult monthlypview(string restcode) { if (restcode == null) { restcode = "HN"; } DateTime DeliverTime = DateTime.Today; DateTime dateTime = Convert.ToDateTime(DeliverTime, new CultureInfo("en-GB")); string DeliverTime1 = dateTime.AddDays(31).ToString("dd/MM/yyyy"); Ankapurservices objCrd = new Ankapurservices(); var modelCust3 = objCrd.monthlyreports(DeliverTime, restcode); foreach (var item in modelCust3) { string orderid = item.OrderId; string amount = item.amountPaid; string total = item.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = item.cgstcharges; string sgst = item.sgstcharges; string deliverycharges = item.Deliverycharges; string status = item.status; string tip = item.Tip; string disco = item.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue2 = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum2 = PriceSum2 + decimal.Parse(amount); } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue2)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum2)); //PriceSum1 += item.amountPaid; // instead of =+ ViewBag.modelCust3 = modelCust3.Count; ViewBag.Pricesum2 = p2; ViewBag.revenue2 = r2; ViewBag.selectdate = DateTime.Now.ToString("dd/MM/yyyy").Replace('-', '/'); ViewBag.selectdate = DeliverTime1; if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; ViewBag.restcode = restcode; } return(PartialView("monthlypview", modelCust3)); }
public ActionResult weeklyreport(DateTime DeliverTime, string restcode) { if (DeliverTime != null) { try { DateTime yesterday1 = DeliverTime.AddDays(-7); ViewBag.selectdate1 = Convert.ToDateTime(yesterday1).ToString("dd/MM/yyyy"); Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.Weeklyreports(DeliverTime, restcode); ViewBag.modelCust = modelCust.Count; foreach (var reports in modelCust) { string amount = reports.amountPaid; string total = reports.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = reports.cgstcharges; string sgst = reports.sgstcharges; string deliverycharges = reports.Deliverycharges; string status = reports.status; string tip = reports.Tip; string disco = reports.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum = PriceSum + decimal.Parse(amount); } } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum)); if (r2 == null || r2 == "") { r2 = "0"; } if (p2 == null || p2 == "") { p2 = "0"; } ViewBag.revenue = r2; ViewBag.Pricesum = p2; ViewBag.selectdate = Convert.ToDateTime(DeliverTime).ToString("dd/MM/yyyy"); ViewBag.selectdate1 = Convert.ToDateTime(yesterday1).ToString("dd/MM/yyyy"); ViewBag.selectdate2 = Convert.ToDateTime(DeliverTime).ToString("yyyy/MM/dd"); ViewBag.restcode = restcode; if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; return(PartialView("weeklyreport", modelCust)); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", "weekreports") + "'</script>")); } } return(PartialView("weeklyreport", null)); }
public ActionResult rangereport(string DeliverTime, string DeliverTime1, string restcode) { if (DeliverTime != null && DeliverTime1 != null) { try { string[] formats = { "dd/MM/yyyy", "dd-MMM-yyyy", "yyyy-MM-dd", "dd-MM-yyyy", "M/d/yyyy", "dd MMM yyyy" }; // DateTime DelTime = Convert.ToDateTime(DeliverTime, //System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat); // DateTime DelTime1 = Convert.ToDateTime(DeliverTime1, //System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat); // string DeliverT = DateTime.ParseExact(DeliverTime, formats, CultureInfo.InvariantCulture, DateTimeStyles.None).ToString("dd/MM/yyyy"); // string DeliverT1 = DateTime.ParseExact(DeliverTime1, formats, CultureInfo.InvariantCulture, DateTimeStyles.None).ToString("dd/MM/yyyy"); string DeliverT = Convert.ToDateTime(DeliverTime).ToString("dd/MM/yyyy"); string DeliverT1 = Convert.ToDateTime(DeliverTime1).ToString("dd/MM/yyyy"); Ankapurservices objCrd = new Ankapurservices(); var modelCust = objCrd.rangereports(DeliverTime, DeliverTime1, restcode); ViewBag.modelCust = modelCust.Count; foreach (var reports in modelCust) { string amount = reports.amountPaid; string total = reports.TotalPrice; if (total == null || total == "") { total = "0"; } string tip = reports.Tip; string disco = reports.Discount; string cgst = reports.cgstcharges; string sgst = reports.sgstcharges; string deliverycharges = reports.Deliverycharges; TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum = PriceSum + decimal.Parse(amount); } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum)); ViewBag.revenue = r2; ViewBag.Pricesum = p2; ViewBag.selectdate = DeliverT1; ViewBag.selectdate1 = DeliverT; ViewBag.restcode = restcode; if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; return(PartialView("rangereport", modelCust)); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", "range") + "'</script>")); } } return(PartialView("rangereport", null)); }
public ActionResult About() { try { string DeliverTime = DateTime.Today.ToString(); //ViewBag.Message = "Your application description page."; Ankapurservices objCrd = new Ankapurservices(); var modelCust1 = objCrd.Getdailyreports(DeliverTime); foreach (var reports in modelCust1) { string amount = reports.amountPaid; string total = reports.TotalPrice; string cgst = reports.cgstcharges; string sgst = reports.sgstcharges; string deliverycharges = reports.Deliverycharges; TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); revenue = TotalPrice + Deliverycharges + sgstcharges + cgstcharges; PriceSum = PriceSum + decimal.Parse(amount); } var modelCust2 = objCrd.Weeklyreports(DeliverTime); foreach (var item in modelCust2) { string amount = item.amountPaid; string total = item.TotalPrice; if (total == null) { total = "0"; } string cgst = item.cgstcharges; string sgst = item.sgstcharges; string deliverycharges = item.Deliverycharges; TotalPrice1 = TotalPrice1 + decimal.Parse(total); Deliverycharges1 = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges1 = sgstcharges + decimal.Parse(sgst); cgstcharges1 = cgstcharges + decimal.Parse(cgst); revenue1 = TotalPrice1 + Deliverycharges1 + sgstcharges1 + cgstcharges1; PriceSum1 = PriceSum1 + decimal.Parse(amount); //PriceSum1 += item.amountPaid; // instead of =+ } var modelCust3 = objCrd.monthlyreports(DeliverTime); foreach (var item in modelCust3) { string amount = item.amountPaid; string total = item.TotalPrice; if (total == null) { total = "0"; } string cgst = item.cgstcharges; string sgst = item.sgstcharges; string deliverycharges = item.Deliverycharges; TotalPrice2 = TotalPrice2 + decimal.Parse(total); Deliverycharges2 = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges2 = sgstcharges + decimal.Parse(sgst); cgstcharges2 = cgstcharges + decimal.Parse(cgst); revenue2 = TotalPrice2 + Deliverycharges2 + sgstcharges2 + cgstcharges2; PriceSum2 = PriceSum2 + decimal.Parse(item.amountPaid); //PriceSum2 += item.amountPaid; // instead of =+ } ViewBag.modelCust1 = modelCust1.Count; ViewBag.modelCust2 = modelCust2.Count; ViewBag.modelCust3 = modelCust3.Count; ViewBag.Pricesum = PriceSum; ViewBag.Pricesum1 = PriceSum1; ViewBag.Pricesum2 = PriceSum2; ViewBag.revenue = revenue; ViewBag.revenue1 = revenue1; ViewBag.revenue2 = revenue2; ViewBag.selectdate = DateTime.Now.ToString("dd/MM/yyyy").Replace('-', '/'); return(View()); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", "Home") + "'</script>")); } }
public ActionResult About(string restcode) { try { if (restcode == null) { restcode = "HN"; } DateTime DeliverTime = DateTime.Today; //ViewBag.Message = "Your application description page."; Ankapurservices objCrd = new Ankapurservices(); var modelCust1 = objCrd.Getdailyreports(DeliverTime, restcode); foreach (var reports in modelCust1) { string amount = reports.amountPaid; string total = reports.TotalPrice; if (total == null || total == "") { total = "0"; } string cgst = reports.cgstcharges; string sgst = reports.sgstcharges; string deliverycharges = reports.Deliverycharges; string status = reports.status; string tip = reports.Tip; string disco = reports.Discount; if (status != "8") { TotalPrice = TotalPrice + decimal.Parse(total); Deliverycharges = Deliverycharges + decimal.Parse(deliverycharges); sgstcharges = sgstcharges + decimal.Parse(sgst); cgstcharges = cgstcharges + decimal.Parse(cgst); tips = tips + decimal.Parse(tip); discounts = discounts + decimal.Parse(disco); revenue2 = TotalPrice + Deliverycharges + sgstcharges + cgstcharges + tips - discounts; PriceSum2 = PriceSum2 + decimal.Parse(amount); } } var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue2)); var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum2)); //PriceSum1 += item.amountPaid; // instead of =+ ViewBag.modelCust = modelCust1.Count; ViewBag.Pricesum = p2; ViewBag.revenue = r2; var modelCust2 = objCrd.Weeklyreports(DeliverTime, restcode); //foreach (var item in modelCust2) //{ // string amount = item.amountPaid; // string total = item.TotalPrice; // if (total == null || total == "") // { // total = "0"; // } // string cgst = item.cgstcharges; // string sgst = item.sgstcharges; // string deliverycharges = item.Deliverycharges; // TotalPrice1 = TotalPrice1 + decimal.Parse(total); // Deliverycharges1 = Deliverycharges + decimal.Parse(deliverycharges); // sgstcharges1 = sgstcharges + decimal.Parse(sgst); // cgstcharges1 = cgstcharges + decimal.Parse(cgst); // revenue1 = TotalPrice1 + Deliverycharges1 + sgstcharges1 + cgstcharges1; // PriceSum1 = PriceSum1 + decimal.Parse(amount); // //PriceSum1 += item.amountPaid; // instead of =+ //} var modelCust3 = objCrd.monthlyreports(DeliverTime, restcode); //foreach (var item in modelCust3) //{ // string amount = item.amountPaid; // string total = item.TotalPrice; // if (total == null || total == "") // { // total = "0"; // } // string cgst = item.cgstcharges; // string sgst = item.sgstcharges; // string deliverycharges = item.Deliverycharges; // TotalPrice2 = TotalPrice2 + decimal.Parse(total); // Deliverycharges2 = Deliverycharges + decimal.Parse(deliverycharges); // sgstcharges2 = sgstcharges + decimal.Parse(sgst); // cgstcharges2 = cgstcharges + decimal.Parse(cgst); // revenue2 = TotalPrice2 + Deliverycharges2 + sgstcharges2 + cgstcharges2; // PriceSum2 = PriceSum2 + decimal.Parse(item.amountPaid); // var r2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(revenue2)); // var p2 = String.Format(new CultureInfo("en-IN", false), "{0:n}", Convert.ToDouble(PriceSum2)); // //PriceSum2 += item.amountPaid; // instead of =+ //} ViewBag.modeldaily = modelCust1; ViewBag.modelCust1 = modelCust1.Count; ViewBag.modelCust2 = modelCust2.Count; ViewBag.modelCust3 = modelCust3.Count; //ViewBag.Pricesum = PriceSum; //ViewBag.Pricesum1 = PriceSum1; //ViewBag.Pricesum2 = PriceSum2; //ViewBag.revenue = revenue; //ViewBag.revenue1 = revenue1; //ViewBag.revenue2 = revenue2; ViewBag.selectdate = DeliverTime.ToString("dd/MM/yyyy").Replace('-', '/'); ViewBag.selectdate1 = DeliverTime.ToString("yyyy/MM/dd").Replace('-', '/'); if (restcode == "HN") { restcode1 = "Himayath Nagar"; } else if (restcode == "KP") { restcode1 = "Kukatpally"; } else if (restcode == "AN") { restcode1 = "A.S.Rao Nagar"; } ViewBag.restcode1 = restcode1; ViewBag.restcode = restcode; return(View()); } catch (Exception) { return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("About", "Home") + "'</script>")); } }