public ActionResult DashBoard(string message = "") { if (sessionDTO.getName() == null) { return(RedirectToAction("Index", "Admin")); } else { string dt = DateTime.Now.ToString("dd/MM/yyyy"); string[] st = dt.Split('/'); //Current Month Stats List <Number> Numlst = new NumberBL().getNumberList().Where(x => x.CreatedAt.Value.Month == Convert.ToInt32(st[1])).ToList(); ViewBag.MNumbersList = Numlst.Count; List <Customer> DNumlst = new CustomerBL().getCustomerList().Where(x => x.CreatedAt.Value.Month == Convert.ToInt32(st[1]) && x.DesiredNumber != null).ToList(); ViewBag.MDNumbersList = DNumlst.Count; List <Customer> SNumlst = new CustomerBL().getCustomerList().Where(x => x.CreatedAt.Value.Month == Convert.ToInt32(st[1]) && x.SellingNumber != null).ToList(); ViewBag.MSNumbersList = SNumlst.Count; List <Subscriber> subslst = new SubscriberBL().getSubscriberList().Where(x => x.CreatedAt.Value.Month == Convert.ToInt32(st[1])).ToList(); ViewBag.SubscribersList = subslst.Count; //Total Stats List <Number> Tnumlst = new NumberBL().getNumberList(); ViewBag.TNumbersList = Tnumlst.Count; List <Customer> TDNumlst = new CustomerBL().getCustomerList().Where(x => x.DesiredNumber != null).ToList(); ViewBag.TDNumbersList = TDNumlst.Count; List <Customer> TSNumlst = new CustomerBL().getCustomerList().Where(x => x.SellingNumber != null).ToList(); ViewBag.TSNumbersList = TSNumlst.Count; List <Subscriber> Tsubslst = new SubscriberBL().getSubscriberList(); ViewBag.TSubscribersList = Tsubslst.Count; ViewBag.message = message; return(View()); } }
public ActionResult DeleteSubscriber(int DnumId) { Subscriber sub = new SubscriberBL().getSubscriberById(DnumId); sub.IsActive = 0; new SubscriberBL().UpdateSubscriber(sub); return(RedirectToAction("SubscribersList", "Admin")); }
public ActionResult SubscribersList() { if (sessionDTO.getName() == null) { return(RedirectToAction("Index", "Admin")); } else { List <Subscriber> subscribers = new SubscriberBL().getSubscriberList().Where(x => x.IsActive == 1).ToList(); ViewBag.subscribers = subscribers; return(View()); } }