public List <Region> RetrieveAllRegions(string textItem) { List <Region> regions = new List <Region>(); RegionDataAccess dataAccess = new RegionDataAccess(); DataTable schemaTable = dataAccess.SelectAll(); foreach (DataRow row in schemaTable.Rows) { Region region = new Region { Id = Convert.ToInt32(row["ID_REGION"]), Nom = row["NOM_REGION"].ToString() }; regions.Add(region); } Region regionItem = new Region { Id = 0, Nom = textItem }; regions.Insert(0, regionItem); return(regions); }
public ActionResult RecoveryExceptionReport() { var branches = new RegionDataAccess().GetAllRegions(); var cardtypes = new CardTypesDataAccess().GetCardTypes("A"); ViewData["Branches"] = branches ?? new List <tbl_Region>(); return(View()); }
public ActionResult CardImportReport() { var viewModel = new List <ReportCardImportVM>(); var branches = new RegionDataAccess().GetAllRegions(); var cardtypes = new CardTypesDataAccess().GetCardTypes("A"); ViewData["Branches"] = branches ?? new List <tbl_Region>(); ViewData["CardTypes"] = cardtypes ?? new List <tbl_Card_Types>(); return(View(viewModel)); }
public JsonResult SearchBranchByCodeNo(string CodeNumber) { RegionDataAccess obj = new RegionDataAccess(); List <ConfigurationVM> lst = new List <ConfigurationVM>(); lst = GetRegionsbyID(CodeNumber); if (lst.Count > 0) { return(Json(new { result = lst.FirstOrDefault(), ErrorMessage = CustomMessages.Success }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { result = lst.FirstOrDefault(), ErrorMessage = CustomMessages.NoValueExist }, JsonRequestBehavior.AllowGet)); } }
public JsonResult UpdateBranch(string Description, string Tilte, string FED, bool?IsActive) { bool success; RegionDataAccess obj = new RegionDataAccess(); tbl_Region lst = new tbl_Region(); //ConfigurationVM lst = new ConfigurationVM(); lst.Description = Description; lst.Title = Tilte; lst.FED = FED; lst.IsActive = IsActive; success = obj.UpdateRegion(lst); if (success == true) { return(Json(new { result = success, ErrorMessage = CustomMessages.Success }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { result = success, ErrorMessage = CustomMessages.GenericErrorMessage }, JsonRequestBehavior.AllowGet)); } }