Exemplo n.º 1
0
 public RegionViewModel FindRegion(int?Id)
 {
     try
     {
         RegionViewModel regionViewModel = new RegionViewModel();
         RegionManager   regionManager   = new RegionManager();
         var             project         = regionManager.FindRegion(Id);
         regionViewModel.Region = project.Region;
         return(regionViewModel);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 2
0
        public void DeleteRegion(RegionViewModel regionViewModel)
        {
            try
            {
                tbl_Region tblRegion = new tbl_Region();
                tblRegion.Id          = regionViewModel.Id;
                tblRegion.EntityState = DA.DomainModel.EntityState.Deleted;

                RegionManager regionManager = new RegionManager();
                regionManager.DeleteRegion(tblRegion);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 3
0
        public void AddRegion(RegionViewModel regionViewModel)
        {
            try
            {
                tbl_Region tblRegion = new tbl_Region();

                tblRegion.Region      = regionViewModel.Region;
                tblRegion.EntityState = DA.DomainModel.EntityState.Added;

                RegionManager regionManager = new RegionManager();
                regionManager.AddRegion(tblRegion);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 4
0
        public bool CheckDuplicate(RegionViewModel regionViewModel)
        {
            try
            {
                RegionManager regionManager = new RegionManager();

                var region = regionManager.FindRegionName(regionViewModel.Region);

                if (region != null && region.Id != regionViewModel.Id && region.Region.ToUpper() == regionViewModel.Region.ToUpper())
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 5
0
        public void GetRegionDetails()
        {
            try
            {
                RegionManager regionManager = new RegionManager();
                var           regionList    = regionManager.GetRegionDetails();

                RegionList = new List <RegionViewModel>();
                foreach (var item in regionList)
                {
                    RegionViewModel Region = new RegionViewModel();

                    Region.Id     = item.Id;
                    Region.Region = item.Region;

                    RegionList.Add(Region);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }