Example #1
0
        public IEnumerable <SelectListItem> GetCustomerDDL(CustomerDDL_VM Model)
        {
            IEnumerable <CustomerDDL_VM> query = new CustomerRepository().GetDataDDL(Model);

            IEnumerable <SelectListItem> list = query.Select(x => new SelectListItem()
            {
                Text = x.CustomerName, Value = x.CustomerID.ToString()
            }).ToList();

            return(list);//.OrderBy(x => x.Text);
        }
Example #2
0
 public JsonResult GetDataDDL(CustomerDDL_VM Model)
 {
     try
     {
         List <CustomerDDL_VM> vm = _CustomerRepo.GetDataDDL(Model);
         return(GetDataResponse(vm));
     }
     catch (Exception ex)
     {
         return(GetDataResponseException(ex));
     }
 }