Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var userId        = User.Identity.GetUserId();
            var UserInfo      = _unitOfWork.UserAccount.GetUserByID(userId);
            var AllCountry    = _unitOfWork.NativeSql.GetAllCountryInfo(UserInfo.fCompanyId);
            var CountryFilter = new CountrySearchFilterVM
            {
                Country = AllCountry
            };

            return(View(CountryFilter));
        }
Ejemplo n.º 2
0
 public JsonResult GetAllCountry(CountrySearchFilterVM Obj)
 {
     try
     {
         var userId     = User.Identity.GetUserId();
         var UserInfo   = _unitOfWork.UserAccount.GetUserByID(userId);
         var AllCountry = _unitOfWork.NativeSql.GetAllCountryInfo(UserInfo.fCompanyId);
         if (AllCountry == null)
         {
             return(Json(new List <CountrySearchFilterVM>(), JsonRequestBehavior.AllowGet));
         }
         if (Obj.CountryID != 0)
         {
             AllCountry = AllCountry.Where(m => m.CountryID == Obj.CountryID).ToList();
         }
         return(Json(AllCountry, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         ViewBag.Error = ex.Message.ToString();
         return(Json(new List <CountrySearchFilterVM>(), JsonRequestBehavior.AllowGet));
     }
 }