Exemplo n.º 1
0
        /// <summary>
        /// Danh sách các Country
        /// </summary>
        /// <returns>List Country</returns>
        public static List <Country> ListOfCountries()
        {
            List <Country> listCountries = new List <Country>();

            listCountries = CatalogBLL.Country_List();
            return(listCountries);
        }
Exemplo n.º 2
0
 [HttpPost] //lkhi submit dữ liệu
 public ActionResult Input(Customer model, string type = "")
 {
     ViewBag.ListCountry = CatalogBLL.Country_List();
     if (string.IsNullOrEmpty(model.CompanyName))
     {
         model.Address = "";
     }
     if (string.IsNullOrEmpty(model.Address))
     {
         model.Address = "";
     }
     if (string.IsNullOrEmpty(model.City))
     {
         model.City = "";
     }
     if (string.IsNullOrEmpty(model.Address))
     {
         model.Address = "";
     }
     if (string.IsNullOrEmpty(model.ContactName))
     {
         model.ContactName = "";
     }
     if (string.IsNullOrEmpty(model.Country))
     {
         model.Country = "";
     }
     if (string.IsNullOrEmpty(model.Fax))
     {
         model.Fax = "";
     }
     if (string.IsNullOrEmpty(model.Phone))
     {
         model.Phone = "";
     }
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     try
     {
         if (type == "Add")
         {
             int supplierId = CatalogBLL.Customers_Add(model);
             return(RedirectToAction("Index"));
         }
         else
         {
             bool updateResult = CatalogBLL.Customers_Update(model);
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", ex.Message + ": " + ex.StackTrace);
         return(View());
     }
 }
        public static List <SelectListItem> listCountrys(bool allowSelectAll = true)
        {
            List <SelectListItem> listCountrys = new List <SelectListItem>();

            foreach (var country in CatalogBLL.Country_List())
            {
                listCountrys.Add(new SelectListItem()
                {
                    Value = country.Name, Text = country.Name
                });
            }
            return(listCountrys);
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static List <SelectListItem> ListOfCountries()
        {
            List <SelectListItem> listCountries = new List <SelectListItem>();

            foreach (var item in CatalogBLL.Country_List())
            {
                listCountries.Add(new SelectListItem()
                {
                    Value = item.Country, Text = item.Country
                });
            }
            return(listCountries);
        }
        // GET: Employee
        public ActionResult Index(int page = 1, string searchValue = "", string country = "")
        {
            var model = new Models.EmployeePaginationResult()
            {
                Page        = page,
                PageSize    = AppSetting.DefaultPageSize,
                RowCount    = HumanResourceBLL.Employee_Count(searchValue, country),
                Data        = HumanResourceBLL.Employee_List(page, AppSetting.DefaultPageSize, searchValue, country),
                SearchValue = searchValue,
                country     = country
            };

            ViewData["country"] = CatalogBLL.Country_List();
            return(View(model));
        }
Exemplo n.º 6
0
        public static List <SelectListItem> ListOfCountries(bool allowSelectAll = true)
        {
            List <SelectListItem> listCountries = new List <SelectListItem>();

            if (allowSelectAll)
            {
                listCountries.Add(new SelectListItem()
                {
                    Value = "", Text = "--- All Country ---"
                });
            }
            foreach (var item in CatalogBLL.Country_List())
            {
                listCountries.Add(new SelectListItem()
                {
                    Value = item.Country, Text = item.Country
                });
            }
            return(listCountries);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Danh sách SelectListItem cho Country
        /// </summary>
        /// <param name="allowSelectAll"></param>
        /// <returns>List SelectListItem</returns>
        public static List <SelectListItem> Country(bool allowSelectAll = true)
        {
            List <SelectListItem> list = new List <SelectListItem>();

            if (allowSelectAll)
            {
                list.Add(new SelectListItem()
                {
                    Value = "", Text = "-- All Countries --"
                });
            }
            foreach (var countries in CatalogBLL.Country_List())
            {
                list.Add(new SelectListItem()
                {
                    Value = countries.CountryName.ToString(),
                    Text  = countries.CountryName
                });
            }
            return(list);
        }