Esempio n. 1
0
        public ViewResult Payments(int customerid)
        {
            ViewBag.CurrentFilter = customerid;
            var Payments = from s in serviceProxy.GetPayments(customerid)
                           select s;

            SCustomer co = serviceProxy.GetCustomer(customerid);

            ViewData["customername"] = co.first_name + " " + co.last_name;

            int pageSize   = 1000;
            int pageNumber = 1;

            return(View(Payments.ToPagedList(pageNumber, pageSize)));
        }
Esempio n. 2
0
        public ViewResult Rentals(int customerid)
        {
            ViewBag.CurrentFilter = customerid;
            var rentals = from r in serviceProxy.GetRentals(customerid)
                          select r;


            if (rentals.ToArray().Length == 0)
            {
                throw new Exception("no rentals found for this customer");
            }
            SCustomer co = serviceProxy.GetCustomer(customerid);

            ViewData["customername"] = co.first_name + " " + co.last_name;

            int pageSize   = 1000;
            int pageNumber = 1;

            return(View(rentals.ToPagedList(pageNumber, pageSize)));
        }
Esempio n. 3
0
        public JsonResult ValidateUser(SCustomer custObj)
        {
            string user;
            int    role;

            try
            {
                role = packXprezObj.ValidateUser(custObj.EmailId, custObj.Password);
                switch (role)
                {
                case 1:
                    user = "******";
                    break;

                case 2:
                    user = "******";
                    break;

                case -1:
                    user = "******";
                    break;

                case -2:
                    user = "******";
                    break;

                default:
                    user = "******";
                    break;
                }
            }
            catch
            {
                user = "******";
                role = -99;
            }
            return(Json(user));
        }
Esempio n. 4
0
        public bool UpdateDetails(SCustomer obj)
        {
            bool status = false;
            int  i;

            try
            {
                i = packXprezObj.updateDetails(obj.Name, obj.Password, obj.EmailId, obj.ContactNo);
                if (i == 1)
                {
                    status = true;
                }
                else
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                status = false;
            }
            return(status);
        }
Esempio n. 5
0
        public ViewResult Details(int id)
        {
            SCustomer customer = serviceProxy.GetCustomer(id);

            return(View(customer));
        }