public ActionResult ManageCityTable() { ManageLocation objManageLocation = new ManageLocation(); ViewBag.PageNumber = (Request.QueryString["grid-page"] == null) ? "1" : Request.QueryString["grid-page"]; using (var con = new SqlConnection(_connectionString)) { var result = con.Query <ManageLocation>("GetLocationDetails", new { }, commandType: CommandType.StoredProcedure).ToList(); // objManageLocation.ManageLocationList return(View(result)); } //return View(objManageLocation); }
public ActionResult AddCityLocation() { ManageLocation ml = new ManageLocation(); ml._CountryList = new SelectList(Enumerable.Empty <SelectListItem>()); ml._StateList = new SelectList(Enumerable.Empty <SelectListItem>()); using (var con = new SqlConnection(_connectionString)) { ml._CountryList = new SelectList(dropdown.BindCountry(), "Value", "Text"); return(View(ml)); } }
public ActionResult AddCityLocation(ManageLocation model) { try { using (var con = new SqlConnection(_connectionString)) { var result = con.Query <int>("Add_Edit_Delete_Location", new { LocationId = "", model.LocationName, model.StateId, model.CountryId, model.DistrictName, model.PinCode, model.IsActive, model.Comments, User = CurrentUser.UserId, Action = "add" }, commandType: CommandType.StoredProcedure).FirstOrDefault(); var response = new ResponseModel(); if (result == 1) { response.IsSuccess = true; response.Response = "Successfully Added"; TempData["response"] = response; } else { response.IsSuccess = true; response.Response = "Location Name Already Exist"; TempData["response"] = response; } } } catch (Exception e) { throw; } return(RedirectToAction("ManageCityLocation")); }
private ManageLocationBo BuiltManageLocationBo(ManageLocation location) { return((ManageLocationBo) new ManageLocationBo().InjectFrom(location)); }