Пример #1
0
        public ActionResult CreateEdit(ULocation location, string Action = "")
        {
            if (ModelState.IsValid)
            {
                if (Action.Equals("Edit"))
                {
                    location._Location.CountryProgrammeId = countryProg.Id;
                    if (locationService.EditLocation(location._Location))
                    {
                        ModelState.Clear();
                        location = new ULocation();
                    }
                }
                else
                {
                    location._Location.CountryProgrammeId = countryProg.Id;
                    if (locationService.AddLocation(location._Location))
                    {
                        ModelState.Clear();
                        location = new ULocation();
                    }
                }
            }

            return(ListView());
        }
Пример #2
0
        public ActionResult AddNewLocation4PO()
        {
            ULocation model = new ULocation();

            model.CountrySelect = new SelectList(locationService.CountryObj.GetCountries(), "Id", "Name");
            model.CountryId     = countryProg.CountryId;
            return(View("AddNewLocation4PO", model));
        }
Пример #3
0
        public ActionResult AddLocation(Guid countryProgId)
        {
            ULocation location = new ULocation();

            location._Location.CountryProgrammeId = countryProgId;
            location.CountrySelect = new SelectList(countryProgService.CountryObj.GetCountries(), "Id", "Name");
            return(View(location));
        }
Пример #4
0
        public ActionResult AddNewLocation4OR(bool final, Guid?otherDDSelectedId)
        {
            ULocation model = new ULocation();

            model.CountrySelect       = new SelectList(locationService.CountryObj.GetCountries(), "Id", "Name");
            model.CountryId           = countryProg.CountryId;
            model.IsFinal             = final;
            ViewBag.OtherDDSelectedId = otherDDSelectedId;
            return(View("AddNewLocation4OR", model));
        }
Пример #5
0
        //
        // GET: CreateEdit
        public ActionResult CreateEdit(string lid)
        {
            ULocation location = new ULocation();

            location.CountrySelect = new SelectList(locationService.CountryObj.GetCountries(), "Id", "Name");

            Guid locationId;

            if (Guid.TryParse(lid, out locationId))
            {
                ViewBag.Action     = Resources.Global_String_Edit;
                location._Location = locationService.GetLocation(locationId);
            }
            return(View(location));
        }
Пример #6
0
        public ActionResult AddNewLocation4OR(ULocation model, bool final, Guid?otherDDSelectedId)
        {
            Location location = locationService.GetLocationByName(model.Name, countryProg.Id);

            if (location == null)
            {
                location                    = new Location();
                location.Name               = model.Name;
                location.Description        = model.Description;
                location.CountryId          = model.CountryId;
                location.CountryProgrammeId = countryProg.Id;
                locationService.AddLocation(location);
            }
            return(RepopulateLocationLists(location.Id, final, otherDDSelectedId));
        }
Пример #7
0
        public ActionResult AddNewLocation4PO(ULocation model)
        {
            Location location = null;

            location = locationService.GetLocationByName(model.Name, countryProg.Id);
            if (location == null)
            {
                location                    = new Location();
                location.Name               = model.Name;
                location.Description        = model.Description;
                location.CountryId          = model.CountryId;
                location.CountryProgrammeId = countryProg.Id;
                //location.IsApproved = false;
                locationService.AddLocation(location);
            }
            return(RepopulateLocationList(location.Id));
        }
Пример #8
0
 public ActionResult AddLocation(ULocation model)
 {
     locationService.AddLocation(model._Location);
     return(Details(model._Location.CountryProgrammeId));
 }