Example #1
0
        public string GetAllCustomers(int pageNumber, string searchTerm, int numberOfRecords, int rating = 0)
        {
            CustomerBusinessActions obj = new CustomerBusinessActions();
            var result = obj.GetAllCustomers(pageNumber, searchTerm, numberOfRecords, rating);
            var json   = new JavaScriptSerializer().Serialize(result);

            return(json);
        }
        public string GetAllCustomers()
        {
            CustomerBusinessActions obj = new CustomerBusinessActions();
            var result = obj.GetAllCustomers(1, string.Empty, 10000, 0, "0");
            var json   = new JavaScriptSerializer().Serialize(result);

            return(json);
        }
        public string GetAllCustomers()
        {
            CustomerBusinessActions obj = new CustomerBusinessActions();
            var result = obj.GetAllCustomers(1, string.Empty, 10000, 0);
            EnquiryBusinessLogic obj1 = new EnquiryBusinessLogic();
            var enq  = obj1.GetAllEnquiries("all", 1, "", 10000, "", "").Where(x => x.ExistingCustomerId == 0).ToList();
            var cust = result.Select(x => new CustomerEnquiryComb {
                Id = x.CustomerId, Name = x.Name, Type = "C"
            }).ToList();
            var en = enq.Select(x => new CustomerEnquiryComb {
                Id = x.EnquiryId, Name = x.Name, Type = "E"
            });
            var combined = cust.Union(en);
            var json     = new JavaScriptSerializer().Serialize(combined);

            return(json);
        }
        public string GetAllCustomers(int pageNumber, string searchTerm, int numberOfRecords, int rating = 0)
        {
            UserModel objUser  = new UserModel();
            string    centerId = "0";

            if (HttpContext.Current.Session["User"] != null)
            {
                objUser = (UserModel)Session["User"];
                if (objUser.RoleId != 1)
                {
                    centerId = objUser.CenterId.ToString();
                }
            }
            CustomerBusinessActions obj = new CustomerBusinessActions();
            var result = obj.GetAllCustomers(pageNumber, searchTerm, numberOfRecords, rating, centerId);
            var json   = new JavaScriptSerializer().Serialize(result);

            return(json);
        }