Пример #1
0
 public IActionResult CreateLocation(LocationDto location)
 {
     if (ModelState.IsValid)
     {
         _location.CreateLocation(location);     //adds data to the DB
         return(RedirectToAction("Location"));   //  Overloaded this controller to the Locatation()
     }                                           //Admin / Location -> View
     else
     {
         return(View(location));
     }
 }
Пример #2
0
 public IActionResult CreateLocation(LocationDto location)
 {
     if (ModelState.IsValid)
     {
         _location.CreateLocation(location);
         return(RedirectToAction("Location"));
     }
     else
     {
         return(View(location));
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Location locations = new Location();

            locations.Location_Description = txt_loationdesc.Text;
            locations.Department_id        = Convert.ToInt32(ddlDepts.SelectedItem.Value);
            locations.Is_Active            = chkActive.Checked ? true : false;
            string result = location.CreateLocation(locations);

            dataTable.Rows.Clear();
            LoadGridTable();
        }