Ejemplo n.º 1
0
        public ActionResult ReRegisterList()
        {
            var date     = DateTime.Now.AddDays(-3);
            var customer = db.Customer.Where(r => r.ReRegisterLastDateTime.Value > date && r.ReRegisterChecked == false);

            string username = HtmlPrivilegedHelper.UserName();

            if (!HtmlPrivilegedHelper.IsAdmin())
            {
                customer = customer.Include(c => c.CustomerStatus).Include(c => c.User).Where(r => r.User.UserName == username);
            }

            return(View(customer));
        }
Ejemplo n.º 2
0
        public ActionResult TicketList(int page = 1)
        {
            int    pageSize       = 15;
            int    pageNumber     = page;
            var    customerticket = db.CustomerTicket.Include(c => c.Customer).OrderByDescending(r => r.Id);
            string username       = HtmlPrivilegedHelper.UserName();

            if (!HtmlPrivilegedHelper.IsAdmin())
            {
                customerticket = db.CustomerTicket.Include(c => c.Customer).Include(c => c.Customer.User).Where(r => r.Customer.User.UserName == username).OrderByDescending(r => r.Id);
            }

            var customerPaged = customerticket.ToPagedList(pageNumber, pageSize);

            foreach (var item in customerPaged)
            {
                var name = item.Customer.User.FirstName;
            }

            return(View(customerPaged));
        }
Ejemplo n.º 3
0
        //
        // GET: /Customer/

        public ActionResult Index(string search, int page = 1, int uid = 0, int cid = 0)
        {
            int    pageSize   = 15;
            int    pageNumber = page;
            var    customer   = db.Customer.Include(c => c.CustomerStatus).Include(c => c.User);
            string username   = HtmlPrivilegedHelper.UserName();

            if (!HtmlPrivilegedHelper.IsAdmin())
            {
                customer = db.Customer.Include(c => c.CustomerStatus).Include(c => c.User).Where(r => r.User.UserName == username);
            }
            if (uid > 0)
            {
                customer = customer.Where(r => r.UserId == uid);
            }

            if (cid > 0)
            {
                customer = customer.Where(r => r.CustomerStatusId == cid);
            }

            if (!string.IsNullOrEmpty(search))
            {
                customer = customer.Where(r => r.FirstName.Contains(search) ||
                                          r.LastName.Contains(search) ||
                                          r.Referance.Contains(search) ||
                                          r.Source.Contains(search));
            }


            customer = customer.OrderByDescending(r => r.CreatedDate);
            var customerPaged = customer.ToPagedList(pageNumber, pageSize);


            return(View(customerPaged));
        }