コード例 #1
0
 private void ScheduleDetailsDelete()
 {
     try
     {
         raceScheduleDetails = new BIZ.RaceScheduleDetails();
         GetControlValue();
         if (ID > 0)
         {
             if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes))
             {
                 PopulateBussinessLayer(Common.Common.RaceScheduleDetails.RaceScheduleDetails);
                 raceScheduleDetails.ScheduleDetailsDelete();
                 ClearControl();
                 ScheduleDetailsSelectAll();
             }
         }
         else
         {
             MessageBox.Show("Record is selected for deletion.", "Error");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
コード例 #2
0
 private void ScheduleDetailsSelectAll()
 {
     try
     {
         raceScheduleDetails = new BIZ.RaceScheduleDetails();
         PopulateBussinessLayer(Common.Common.RaceScheduleDetails.RaceScheduleDetails);
         raceScheduleDetails.ScheduleDetailsSelectAll(this.dataGridView1);
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
コード例 #3
0
 private void Save()
 {
     try
     {
         raceScheduleDetails = new BIZ.RaceScheduleDetails();
         GetControlValue();
         PopulateBussinessLayer(Common.Common.RaceScheduleDetails.RaceScheduleDetails);
         if (raceScheduleDetails.Save())
         {
             ClearControl();
             this.txtScheduleName.Focus();
             ScheduleDetailsSelectAll();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
コード例 #4
0
 private void GetLocationDetails()
 {
     try
     {
         DataTable dtResult;
         raceScheduleDetails = new BIZ.RaceScheduleDetails();
         GetControlValue();
         PopulateBussinessLayer(Common.Common.RaceScheduleDetails.RaceScheduleDetails);
         dtResult = raceScheduleDetails.ScheduleDetailsSearchByKey();
         if (dtResult.Rows.Count > 0)
         {
             RecordSearched = dtResult;
             PopulateControl();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
コード例 #5
0
        private void grid_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DataGridView datagrid = this.dataGridView1;
                Int64        index;
                String       time = "";
                String[]     hm;

                string value = Thread.CurrentThread.CurrentUICulture.Name;

                if (datagrid.RowCount > 0)
                {
                    raceScheduleDetails = new BIZ.RaceScheduleDetails();
                    index = datagrid.CurrentRow.Index;
                    if ((string)datagrid.CurrentCell.Value.ToString() == "EDIT")
                    {
                        LocationName = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[3].Value);
                        if (LocationName != "")
                        {
                            this.cmbLocation.SelectedItem = LocationName;
                            this.txtID.Text           = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[0].Value);
                            this.txtLocationID.Text   = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[1].Value);
                            this.dtpLoadingDate.Value = Common.Common.ConvertDate((datagrid.Rows[Convert.ToInt32(index)].Cells[5].Value.ToString()));
                            string[] loadingTime = datagrid.Rows[Convert.ToInt32(index)].Cells[6].Value.ToString().Split('-');
                            this.txtLoadingTimeFrom.Text = loadingTime.GetValue(0).ToString().Trim();
                            this.txtLoadingTimeTo.Text   = loadingTime.GetValue(1).ToString().Trim();
                            this.dtpDateRelease.Value    = Common.Common.ConvertDate(datagrid.Rows[Convert.ToInt32(index)].Cells[7].Value.ToString());

                            //release point details
                            this.txtReleasePointID.Text = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[9].Value);
                            this.txtLapNo.Text          = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[10].Value);
                            this.txtMultiplier.Text     = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[11].Value);
                            this.cmbMinSpeed.Text       = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[12].Value);
                            this.txtRemarks.Text        = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[13].Value);
                            this.chkIsStop.Checked      = Convert.ToBoolean(datagrid.Rows[Convert.ToInt32(index)].Cells[14].Value);

                            if (chkIsStop.Checked)
                            {
                                this.dtpStopFromDate.Value = Common.Common.ConvertDate(datagrid.Rows[Convert.ToInt32(index)].Cells[15].Value.ToString());
                                this.txtStopFromTime.Text  = datagrid.Rows[Convert.ToInt32(index)].Cells[16].Value.ToString();
                                this.dtpStopToDate.Value   = Common.Common.ConvertDate(datagrid.Rows[Convert.ToInt32(index)].Cells[17].Value.ToString());
                                this.txtStopToTime.Text    = datagrid.Rows[Convert.ToInt32(index)].Cells[18].Value.ToString();
                            }
                            else
                            {
                                this.dtpStopFromDate.Value = DateTime.Now;
                                this.txtStopFromTime.Text  = "00:00";
                                this.dtpStopToDate.Value   = DateTime.Now;
                                this.txtStopToTime.Text    = "00:00";
                            }
                            //this.dtpDateRelease.Value = Convert.ToDateTime(datagrid.Rows[Convert.ToInt32(index)].Cells[9].Value);
                            time = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[8].Value);
                            hm   = time.Split(':');

                            if (hm.Length == 2)
                            {
                                if (Convert.ToString(hm[0]).Length == 1)
                                {
                                    this.cmbHour.Text = "0" + Convert.ToString(hm[0]);
                                }
                                else
                                {
                                    this.cmbHour.Text = Convert.ToString(hm[0]);
                                }
                                this.cmbMinute.Text = Convert.ToString(hm[1]);
                            }
                            else
                            {
                                cmbHour.Text   = "";
                                cmbMinute.Text = "";// .Text = "";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }