Exemplo n.º 1
0
        private void PopulateCombobox()
        {
            try
            {
                //Direction Sign
                this.cmbLatSign.Items.Add("N");
                this.cmbLatSign.Items.Add("S");
                this.cmbLongSign.Items.Add("E");
                this.cmbLongSign.Items.Add("W");

                //Region
                region = new BIZ.Region();
                PopulateBussinessLayer(Common.Common.Location.Region);

                //Race Region
                DataTable dtregion;
                dtregion = region.RegionGetByKey().Tables[0];
                if (dtregion.Rows.Count > 0)
                {
                    foreach (DataRow dtrow in dtregion.Rows)
                    {
                        cmbRegion.Items.Add(dtrow["RegionName"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }
Exemplo n.º 2
0
 private void RegionSelectAll()
 {
     try
     {
         region = new BIZ.Region();
         PopulateBussinessLayer();
         region.RegionSelectAll(this.dataGridView1);
         if (this.dataGridView1.ColumnCount > 0)
         {
             this.dataGridView1.Columns[0].Visible = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Exemplo n.º 3
0
 private void Save()
 {
     try
     {
         region = new BIZ.Region();
         GetControlValue();
         PopulateBussinessLayer();
         if (region.Save())
         {
             ClearControl();
             //this.txtLocationName.Focus();
             RegionSelectAll();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Exemplo n.º 4
0
        private void PopulateCombobox()
        {
            try
            {
                //Region
                region = new BIZ.Region();
                PopulateBussinessLayer(Common.Common.Schedule.Region);

                //Race Region
                DataTable dtregion;
                dtregion = region.RegionGetByKey().Tables[0];
                if (dtregion.Rows.Count > 0)
                {
                    foreach (DataRow dtrow in dtregion.Rows)
                    {
                        cmbRegion.Items.Add(dtrow["RegionName"].ToString());
                    }
                }

                //Race Season
                DataTable dtSeason;
                dtSeason = region.GetRaceSeason().Tables[0];
                if (dtSeason.Rows.Count > 0)
                {
                    foreach (DataRow dtrow in dtSeason.Rows)
                    {
                        cmbSeason.Items.Add(dtrow["Description"].ToString());
                    }
                }

                this.cmbYear.Items.Clear();
                for (int i = DateTime.Now.Year; i < DateTime.Now.Year + 5; i++)
                {
                    this.cmbYear.Items.Add(i);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }
Exemplo n.º 5
0
 private void RegionDelete()
 {
     try
     {
         region = new BIZ.Region();
         GetControlValue();
         if (RegionID > 0)
         {
             if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes))
             {
                 PopulateBussinessLayer();
                 region.RegionDelete();
                 ClearControl();
                 RegionSelectAll();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }