Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public ActionResult RecoveryExceptionReport()
        {
            var branches  = new RegionDataAccess().GetAllRegions();
            var cardtypes = new CardTypesDataAccess().GetCardTypes("A");

            ViewData["Branches"] = branches ?? new List <tbl_Region>();

            return(View());
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
            }
        }
Esempio n. 5
0
        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));
            }
        }