Ejemplo n.º 1
0
        public ActionResult downloaddaily(string restcode)
        {
            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);
            var             gv         = new GridView();

            gv.DataSource = modelCust1;
            gv.DataBind();
            Response.ClearContent();
            Response.Buffer = true;
            Response.AddHeader("content-disposition", "attachment; filename=ankapurchickenDaily.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"));
        }
Ejemplo n.º 2
0
        public ActionResult previousdaily(DateTime DeliverTime, string restcode)
        {
            DateTime dateTime1 = DeliverTime.AddDays(-1);

            Ankapurservices objCrd = new Ankapurservices();
            // return Content("<script language='javascript' type='text/javascript'>alert('"+ dateTime1 + "');</script>");
            var modelCust = objCrd.Getdailyreports(dateTime1, 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.selectdate  = dateTime1.ToString("dd/MM/yyyy"); //dd/MM/yyyy
            ViewBag.selectdate1 = dateTime1.ToString("yyyy/MM/dd");
            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));
        }
Ejemplo n.º 3
0
        public PartialViewResult dailytable(string DeliverTime)
        {
            DeliverTime = DateTime.Today.ToString();
            Ankapurservices objCrd    = new Ankapurservices();
            var             modelCust = objCrd.Getdailyreports(DeliverTime);

            return(PartialView("dailytable", modelCust));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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>"));
            }
        }
Ejemplo n.º 6
0
        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>"));
            }
        }
Ejemplo n.º 7
0
        public ActionResult Dailyreport(DateTime DeliverTime, string restcode)
        {
            if (DeliverTime != null)
            {
                try
                {
                    string DeliverTime1 = Convert.ToDateTime(DeliverTime).ToString("dd/MM/yyyy");


                    Ankapurservices objCrd    = new Ankapurservices();
                    var             modelCust = objCrd.Getdailyreports(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 tip             = reports.Tip;
                        string disco           = reports.Discount;
                        string cgst            = reports.cgstcharges;
                        string sgst            = reports.sgstcharges;
                        string deliverycharges = reports.Deliverycharges;
                        string status          = reports.status;

                        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));
                    ViewBag.revenue     = r2;
                    ViewBag.Pricesum    = p2;
                    ViewBag.selectdate  = DeliverTime1;
                    ViewBag.selectdate1 = DeliverTime.ToString("yyyy/MM/dd").Replace('-', '/');
                    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("dailyreport", modelCust));
                }
                catch (Exception)
                {
                    return(Content("<script language='javascript' type='text/javascript'>alert('Restaurant is closed at the moment');location.href='" + @Url.Action("Index", "dailyReports") + "'</script>"));
                }
            }
            return(PartialView("dailyreport", null));
        }