private void ButtonDelete_Click(object sender, EventArgs e) { if (newLocation.LocationID > 0) { MessageForm messageForm = new MessageForm(); LocationDA locationDA = new LocationDA(); if (!locationDA.DoesLocationHaveLands(newLocation)) { bool success = locationDA.DeleteLocation(newLocation); if (success) { messageForm.MessageText = "उक्त स्थानको विवरण सफलतापूर्वक मेटाइयो।"; messageForm.ShowDialog(); } } else { messageForm.MessageText = "उक्त स्थानमा जग्गा भएको हुँदा सो स्थानको विवरण मेटाउन सकिएन।"; messageForm.ShowDialog(); } Sanitize(); } }
public DataTable GetExistingdBusBL() { DataTable dt = new DataTable(); LocationDA locationDAOBj = new LocationDA(); dt = locationDAOBj.GetExistingLocationFromDB(); return(dt); }
private void ButtonSave_Click(object sender, EventArgs e) { LocationDA locationDA = new LocationDA(); MessageForm messageForm = new MessageForm(); newLocation.LocationPreviousVDC = TextBoxLocation.Text; newLocation.LocationNewLevel = TextBoxLocalLevel.Text; bool result = false; if (newLocation.LocationID > 0) { // Update the location information try { result = locationDA.UpdateLocation(newLocation); } catch (Exception) { messageForm.MessageText = "केही आन्तरिक त्रुटीको कारण स्थानको विवरण अद्यावधिक गर्न सकिएन।"; messageForm.ShowDialog(); } if (result) { messageForm.MessageText = "उक्त स्थानको विवरण सफलतापूर्वक अद्यावधिक गरियो।"; messageForm.ShowDialog(); } } else { if (!locationDA.IsDuplicateLocation(newLocation)) { try { result = locationDA.SaveLocation(newLocation); } catch (Exception) { messageForm.MessageText = "ओहो! केही आन्तरिक त्रुटीको कारण नयाँ स्थानको विवरण सुरक्षित गर्न सकिएन।"; messageForm.ShowDialog(); } if (result) { messageForm.MessageText = "नयाँ स्थानको विवरण सफलतापूर्वक सुरक्षित गरियो।"; messageForm.ShowDialog(); } } else { messageForm.MessageText = "उक्त स्थानको विवरण पहिले नै सुरक्षित गरिसकेको छ।"; messageForm.ShowDialog(); } } Sanitize(); }
private void PopulateLocationListBox() { List <Location> locations = new List <Location>(); LocationDA locDa = new LocationDA(); locations = locDa.GetLocationsHavingLands(); ListBoxLocations.DataSource = locations; ListBoxLocations.DisplayMember = "LocationPreviousVDC"; ListBoxLocations.ValueMember = "LocationID"; }
public bool DeleteALocationBL(Location aLocation) { if (aLocation.LocationName == "" || aLocation.Details == "") { return(false); } else { LocationDA locationDAOBj = new LocationDA(); bool result = locationDAOBj.DeleteLocationFromDB(aLocation); return(result); } }
public bool UpdateNewLocationBL(Location aLocation) { if (aLocation.LocationName == "" || aLocation.Details == "") { return(false); } else { LocationDA locationDAOBj = new LocationDA(); bool result = locationDAOBj.UpdateNewLocationToDB(aLocation); return(result); } }
public decimal Location_Insert(LocationInfo Obj_Info) { decimal ck = -1; try { LocationDA _da = new LocationDA(); ck = _da.Insert(Obj_Info); } catch (Exception ex) { NaviCommon.Common.log.Error(ex.ToString()); } return(ck); }
public List <LocationInfo> Location_GetAll() { List <LocationInfo> list = new List <LocationInfo>(); try { LocationDA _da = new LocationDA(); list = CBO <LocationInfo> .FillCollectionFromDataSet(_da.Location_GetAll()); } catch (Exception ex) { NaviCommon.Common.log.Error(ex.ToString()); } return(list); }
public List <LocationInfo> Location_Search(string keysearch, ref decimal p_total_record, string p_from = "1", string p_to = "10") { List <LocationInfo> list = new List <LocationInfo>(); LocationDA _da = new LocationDA(); try { list = CBO <LocationInfo> .FillCollectionFromDataSet(_da.Location_Search(keysearch, p_from, p_to, ref p_total_record)); } catch (Exception ex) { NaviCommon.Common.log.Error(ex.ToString()); list = new List <LocationInfo>(); } return(list); }
private void NewLandForm_Load(object sender, EventArgs e) { try { LocationDA locDA = new LocationDA(); ComboBoxLocation.DataSource = locDA.GetLocations(); ComboBoxLocation.DisplayMember = "LocationPreviousVDC"; ComboBoxLocation.ValueMember = "LocationID"; } catch (Exception) { MessageForm messageForm = new MessageForm(); messageForm.MessageText = "ओहो! केही आन्तरिक त्रुटीको कारण जग्गा भएको स्थानको विवरण लोड गर्न सकिएन।"; messageForm.ShowDialog(); } }
private void PopulateLocations() { // Fill in Locations try { LocationDA locDA = new LocationDA(); ComboBoxLocation.DataSource = locDA.GetLocationsHavingLands(); ComboBoxLocation.DisplayMember = "LocationPreviousVDC"; ComboBoxLocation.ValueMember = "LocationID"; } catch (Exception) { MessageForm messageForm = new MessageForm(); messageForm.MessageText = "ओहो! केही आन्तरिक त्रुटीको कारण जग्गा भएको स्थानको विवरण लोड गर्न सकिएन।"; messageForm.ShowDialog(); } }
private void PopulateLocations() { LocationDA locationDA = new LocationDA(); List <Location> locations = locationDA.GetLocations(); DataGridViewLocations.Rows.Clear(); for (int i = 0; i < locations.Count; i++) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(DataGridViewLocations); row.Cells[0].Value = Helper.GetNepaliNumber(i + 1); row.Cells[1].Value = locations[i].LocationPreviousVDC; row.Cells[2].Value = locations[i].LocationNewLevel; // Store location_id as Tag row.Tag = locations[i].LocationID.ToString(); DataGridViewLocations.Rows.Add(row); } }
public ActionResult FindWeather(WeatherVM model) { model.Date = DateTime.Now; using (Context ctx = new Context()) { LocationDA locationDA = new LocationDA(ctx); model.Location = locationDA.GetLocationByZip(model.ZipCode); WeatherDA weatherDA = new WeatherDA(ctx); model.TodaysWeather = weatherDA.GetTodaysWeatherByZip(model.ZipCode, model.Date); } //model.ZipCode = 30809; //model.Location = "Evans, GA"; //model.TodaysWeather = new List<Weather>(); //model.TodaysWeather.Add( // new Weather // { // Temperature = 70, // Status = WeatherType.Sunny, // TimePeriod = TimePeriod.Morning // } //); //model.TodaysWeather.Add( // new Weather // { // Temperature = 95, // Status = WeatherType.Rainy, // TimePeriod = TimePeriod.Afternoon // } //); //model.TodaysWeather.Add( // new Weather // { // Temperature = 75, // Status = WeatherType.Cloudy, // TimePeriod = TimePeriod.Night // } //); return(PartialView("_TodaysWeather", model)); }
public LocationFactory() { locDa = new LocationDA(); }
public LocationController(IConfiguration Configuration, IDataAccess DAccess) { this.Configuration = Configuration; this.DAccess = DAccess; this.DALocation = new LocationDA(ref DAccess, "Location"); }