Exemplo n.º 1
0
        // GET: Reservation
        public ActionResult Index()
        {
            var model = new CMS_ReservationViewModels();

            try
            {
                model.ListProducts  = _facProduct.GetList((byte)CMS_Common.Commons.EProductType.Procudure);
                model.ListCustomer  = _facCus.GetList();
                model.ListEmployees = _facEmp.GetList();
            }
            catch (Exception ex)
            {
                NSLog.Logger.Error("Reservation Index", ex);
            }
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Create()
        {
            CMS_OrderAdminModels model = new CMS_OrderAdminModels();

            model.Items = _facPro.GetList().Select(o => new CMS_ItemModels {
                Price       = o.ProductPrice,
                ProductID   = o.Id,
                ProductName = o.ProductName,
            }).OrderBy(o => o.ProductName).ToList();

            model.Customers = _facCus.GetList().Select(o => new CMS_CustomerAnonymousModels
            {
                FirstName = o.FirstName,
                LastName  = o.LastName,
                Address   = o.Address,
                Id        = o.ID,
                City      = o.City,
                Company   = o.CompanyName,
                Country   = o.Country,
                Email     = o.Email,
                Phone     = o.Phone,
                PostCode  = o.Postcode
            }).OrderBy(o => o.Name).ToList();
            model.Discounts = _facDiscount.GetList();
            model.Employees = _facEmp.GetList();
            return(PartialView("_Create", model));
        }
Exemplo n.º 3
0
        // GET: Clients/Home
        public ActionResult Index()
        {
            try
            {
                ProductViewModels model = new ProductViewModels();

                //Company
                model.Company = _facCom.GetList().FirstOrDefault();

                //Category
                model.ListCate = _facCate.GetList().Where(o => o.ProductTypeCode == (int)Commons.EProductType.Procudure).OrderByDescending(x => x.CreatedDate).Skip(0).Take(3).ToList();

                //Product
                var productType = (byte)Commons.EProductType.Product;
                model.ListProduct = _fac.GetList(productType).Where(o => !string.IsNullOrEmpty(o.ImageURL)).OrderByDescending(x => x.CreatedDate).Skip(0).Take(8).ToList();

                //Procedures
                model.ListProcedures = _facProce.GetList().OrderBy(o => o.CreatedDate).Skip(0).Take(3).ToList();
                //News
                model.ListNews = _facNews.GetList().OrderByDescending(x => x.CreatedDate).Skip(0).Take(3).ToList();
                if (model.ListNews != null && model.ListNews.Any())
                {
                    model.ListNews.ForEach(x =>
                    {
                        if (!string.IsNullOrEmpty(x.ImageURL))
                        {
                            x.ImageURL = "~/Uploads/News/" + x.ImageURL;
                        }
                    });
                }

                model.ListEmployee = _facEmp.GetList().OrderBy(o => o.CreatedDate).Skip(0).Take(10).ToList();
                if (model.ListEmployee != null)
                {
                    model.ListEmployee.ForEach(o =>
                    {
                        o.ImageURL = !string.IsNullOrEmpty(o.ImageURL) ? Commons._PublicImages + "Employees/" + o.ImageURL : Commons._ImageDefault;
                    });
                }

                model.LstDiscount = _facDis.GetList(true);

                return(View(model));
            }
            catch (Exception ex)
            {
                // NSLog.Logger.Error("Index: ", ex);
                return(new HttpStatusCodeResult(400, ex.Message));
            }
        }
        public ActionResult LoadGrid()
        {
            var model = _factory.GetList();

            model.ForEach(x =>
            {
                x.sStatus = x.IsActive ? "Kích hoạt" : "Chưa kích hoạt";
                if (!string.IsNullOrEmpty(x.ImageURL))
                {
                    x.ImageURL = Commons.HostImage + "Employees/" + x.ImageURL;
                }
            });
            return(PartialView("_ListData", model));
        }
Exemplo n.º 5
0
        public List <SelectListItem> GetListEmployeeSelectItem()
        {
            var _factory = new CMSEmployeeFactory();
            List <SelectListItem> data = null;

            var listEmp = _factory.GetList();

            if (listEmp != null)
            {
                data = listEmp.Select(x => new SelectListItem
                {
                    Value = x.Id,
                    Text  = x.Name,
                }).ToList();
            }
            return(data);
        }
Exemplo n.º 6
0
        // GET: Clients/About
        public ActionResult Index()
        {
            ProductViewModels model = new ProductViewModels();

            // employee
            model.ListEmployee = _facEmp.GetList().OrderBy(x => x.Level).Skip(0).Take(4).ToList();
            if (model.ListEmployee != null && model.ListEmployee.Any())
            {
                model.ListEmployee.ForEach(x =>
                {
                    if (!string.IsNullOrEmpty(x.ImageURL))
                    {
                        x.ImageURL = "~/Uploads/Employees/" + x.ImageURL;
                    }
                    else
                    {
                        x.ImageURL = Commons.Image268_297;
                    }
                });
            }
            return(View(model));
        }
Exemplo n.º 7
0
        // GET: Clients/About
        public ActionResult Index()
        {
            var model = new CMS_AboutViewModels();

            try
            {
                model.Categories = _facCate.GetList().Where(x => x.ProductTypeCode == (int)Commons.EProductType.Procudure).OrderByDescending(x => x.CreatedDate).Skip(0).Take(3).ToList();
                model.Employees  = _facEmp.GetList().OrderByDescending(x => x.CreatedDate).Skip(0).Take(3).ToList();
                if (model.Employees != null)
                {
                    model.Employees.ForEach(o =>
                    {
                        o.ImageURL = !string.IsNullOrEmpty(o.ImageURL) ? Commons._PublicImages + "Employees/" + o.ImageURL : "";
                    });
                }
                model.LstDiscount = _facDis.GetList(true);
            }
            catch (Exception ex)
            {
                NSLog.Logger.Error("About Index", ex);
            }
            return(View(model));
        }
Exemplo n.º 8
0
        // GET: Clients/Home
        public ActionResult Index()
        {
            try
            {
                ProductViewModels model = new ProductViewModels();

                //Company
                model.Company = _facCom.GetList().FirstOrDefault();

                //Category
                model.ListCate = _facCate.GetList().OrderByDescending(x => x.CreatedDate).Skip(0).Take(4).ToList();
                if (model.ListCate != null && model.ListCate.Any())
                {
                    model.ListCate.ForEach(x =>
                    {
                        if (!string.IsNullOrEmpty(x.ImageURL))
                        {
                            x.ImageURL = "~/Uploads/Categories/" + x.ImageURL;
                        }
                    });
                }

                //Product
                model.ListProduct = _fac.GetList().OrderByDescending(x => x.CreatedDate).Skip(0).Take(8).ToList();
                var dataImage = _fac.GetListImage();
                if (model.ListProduct != null && model.ListProduct.Any())
                {
                    model.ListProduct.ForEach(x =>
                    {
                        var _Image = dataImage.FirstOrDefault(z => z.ProductId.Equals(x.Id));
                        if (_Image != null)
                        {
                            x.ImageURL = _Image.ImageURL;
                            if (!string.IsNullOrEmpty(x.ImageURL))
                            {
                                x.ImageURL = "~/Uploads/Products/" + x.ImageURL;
                            }
                            else
                            {
                                x.ImageURL = "";
                            }
                        }
                    });
                }

                //News
                model.ListNews = _facNews.GetList().OrderByDescending(x => x.CreatedDate).Skip(0).Take(3).ToList();
                if (model.ListNews != null && model.ListNews.Any())
                {
                    model.ListNews.ForEach(x =>
                    {
                        if (!string.IsNullOrEmpty(x.ImageURL))
                        {
                            x.ImageURL = "~/Uploads/News/" + x.ImageURL;
                        }
                    });
                }

                // employee
                model.ListEmployee = _facEmp.GetList().OrderBy(x => x.Level).Skip(0).Take(4).ToList();
                if (model.ListEmployee != null && model.ListEmployee.Any())
                {
                    model.ListEmployee.ForEach(x =>
                    {
                        if (!string.IsNullOrEmpty(x.ImageURL))
                        {
                            x.ImageURL = "~/Uploads/Employees/" + x.ImageURL;
                        }
                        else
                        {
                            x.ImageURL = Commons.Image268_297;
                        }

                        if (string.IsNullOrEmpty(x.LinkFB))
                        {
                            x.LinkFB = "javascript:void(0)";
                        }
                        if (string.IsNullOrEmpty(x.LinkInstagram))
                        {
                            x.LinkInstagram = "javascript:void(0)";
                        }
                        if (string.IsNullOrEmpty(x.LinkPinterest))
                        {
                            x.LinkPinterest = "javascript:void(0)";
                        }
                        if (string.IsNullOrEmpty(x.LinkTwiter))
                        {
                            x.LinkTwiter = "javascript:void(0)";
                        }
                    });
                }
                return(View(model));
            }
            catch (Exception ex)
            {
                // NSLog.Logger.Error("Index: ", ex);
                return(new HttpStatusCodeResult(400, ex.Message));
            }
        }