Ejemplo n.º 1
0
        private void grid_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DataGridView datagrid = this.dataGridView1;
                Int64        index;
                if (datagrid.RowCount > 0)
                {
                    location   = new BIZ.Location();
                    index      = datagrid.CurrentRow.Index;
                    LocationID = Convert.ToInt64(datagrid.Rows[Convert.ToInt32(index)].Cells[0].Value);
                    if (LocationID > 0)
                    {
                        DataTable dtresult = LocationGet();
                        //PopulateBussinessLayer(Common.Common.Location.Location);
                        //dtresult = location.LocationSearchByKey();

                        if (dtresult.Rows.Count > 0)
                        {
                            RecordSearched = dtresult;
                            PopulateControl();
                        }
                        else
                        {
                            MessageBox.Show("No record is found", "Search");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }
Ejemplo n.º 2
0
 private void LocationSelectAll()
 {
     try
     {
         location = new BIZ.Location();
         PopulateBussinessLayer(Common.Common.Location.Location);
         location.LocationSelectAll(this.dataGridView1);
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Ejemplo n.º 3
0
        private void PopulateCombobox()
        {
            try
            {
                DataTable dtLocation;
                location = new BIZ.Location();
                PopulateBussinessLayer(Common.Common.RaceScheduleDetails.Location);
                dtLocation = location.LocationSelectAll();

                foreach (DataRow dr in dtLocation.Rows)
                {
                    this.cmbLocation.Items.Add(dr["LocationName"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }
Ejemplo n.º 4
0
 private void Save()
 {
     try
     {
         location = new BIZ.Location();
         GetControlValue();
         PopulateBussinessLayer(Common.Common.Location.Location);
         if (location.Save())
         {
             ClearControl();
             this.txtLocationName.Focus();
             LocationSelectAll();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Ejemplo n.º 5
0
 private void PopulateCombobox()
 {
     try
     {
         DataTable dtLocation;
         location = new BIZ.Location();
         PopulateBussinessLayer(Common.Common.RaceEntryClassType.Location);
         dtLocation = location.LocationSearchByScheduleCategory();
         this.cmbLocationName.Items.Add("");
         foreach (DataRow dr in dtLocation.Rows)
         {
             this.cmbLocationName.Items.Add(dr["LocationName"].ToString());
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Ejemplo n.º 6
0
 private void GetLocationDetails()
 {
     try
     {
         DataTable dtResult;
         location = new BIZ.Location();
         GetControlValue();
         PopulateBussinessLayer(Common.Common.RaceScheduleDetails.Location);
         dtResult = location.LocationSearchByKey();
         if (dtResult.Rows.Count > 0)
         {
             RecordSearched = dtResult;
             PopulateControl();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Ejemplo n.º 7
0
 private void LocationDelete()
 {
     try
     {
         location = new BIZ.Location();
         GetControlValue();
         if (LocationID > 0)
         {
             if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes))
             {
                 PopulateBussinessLayer(Common.Common.Location.Location);
                 location.LocationDelete();
                 ClearControl();
                 LocationSelectAll();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }