예제 #1
0
        private void EClockReleasePointExport(String Drive)
        {
            DataTable dt = new DataTable();

            BIZ.RaceReleasePoint raceReleasePoint = new BIZ.RaceReleasePoint();
            raceReleasePoint.ClubID = ClubID;
            dt = raceReleasePoint.EClockRaceReleasePoint();

            this.progressBar2.Minimum = 0;
            this.progressBar2.Maximum = dt.Rows.Count;
            this.progressBar2.Step    = 1;
            this.progressBar2.Value   = 0;

            string path       = Drive + @"ReleasePoint.inf";
            string collection = "";

            if (File.Exists(path))
            {
                File.Delete(path);
            }
            if (!File.Exists(path))
            {
                // Create a file to write to.
                using (StreamWriter sw = File.CreateText(path))
                {
                    foreach (DataRow item in dt.Rows)
                    {
                        collection = ClubID.ToString() + "|" + item["RaceScheduleID"].ToString() + "|" + item["RaceScheduleName"].ToString() + "|" + item["RaceScheduleCategoryID"].ToString() + "|" + item["RaceScheduleCategoryName"].ToString() + item["RaceScheduleDetailsID"].ToString() + item["LocationID"].ToString() + item["LocationName"].ToString() + item["RaceReleasePointID"].ToString() + item["LapNo"].ToString() + item["MinSpeed"].ToString() + item["DateRelease"].ToString();
                        sw.WriteLine(Common.Common.Encrypt(collection));
                        System.Threading.Thread.Sleep(50);
                        this.progressBar2.PerformStep();
                    }
                }
            }
        }
예제 #2
0
 private void ReleasePointSelectAll()
 {
     try
     {
         raceReleasePoint = new BIZ.RaceReleasePoint();
         PopulateBussinessLayer(Common.Common.RaceEntryClassType.RaceReleasePoint);
         raceReleasePoint.RaceReleasePointSelectAll(this.dataGridView1);
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
예제 #3
0
        private void GetRaceReleasePointBySchedule()
        {
            BIZ.RaceReleasePoint raceReleasePoint = new BIZ.RaceReleasePoint();
            raceReleasePoint.ClubID           = ClubID;
            raceReleasePoint.RaceScheduleName = cmbSchedule.Text;
            RaceReleasePoint = raceReleasePoint.GetRaceReleasePointBySchedule();

            if (RaceReleasePoint.Rows.Count > 0)
            {
                foreach (DataRow dr in RaceReleasePoint.Rows)
                {
                    this.cmbLocation.Items.Add(dr["ReleasePoint"]);
                }
            }
        }
예제 #4
0
        private void dtReleasePoint_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DataGridView datagrid = this.dtReleasePoint;
                Int64        index;

                if (datagrid.RowCount > 0)
                {
                    index = datagrid.CurrentRow.Index;
                    if ((string)datagrid.CurrentCell.Value.ToString() == "SELECT")
                    {
                        ID = Convert.ToInt64(datagrid.Rows[Convert.ToInt32(index)].Cells[1].Value);
                        raceReleasePoint = new BIZ.RaceReleasePoint();

                        if (ID > 0)
                        {
                            RaceReleasePointID = ID;
                            DataTable dtresult = new DataTable();
                            PopulateBusinessLayer(Common.Common.RaceEntryClassType.RaceReleasePoint);
                            dtresult = raceReleasePoint.RaceReleasePointGetbyKey();

                            if (dtresult.Rows.Count > 0)
                            {
                                frmEntryBird entryBird = new frmEntryBird();
                                entryBird.RaceReleasePointData = dtresult;
                                entryBird.ClubID = ClubID;
                                entryBird.UserID = UserID;
                                entryBird.PopulateControlValue("RaceReleasePoint");
                                entryBird.ShowDialog();
                                //MemberDetailsSelectAll(); //Refresh value of data grid
                            }
                            else
                            {
                                MessageBox.Show("No record is found", "Search");
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }
예제 #5
0
 private void Save()
 {
     try
     {
         raceReleasePoint = new BIZ.RaceReleasePoint();
         GetControlValue();
         PopulateBussinessLayer(Common.Common.RaceEntryClassType.RaceReleasePoint);
         if (raceReleasePoint.Save())
         {
             this.txtScheduleCategoryName.Focus();
             ReleasePointSelectAll();
             ClearControl();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
예제 #6
0
        private void RaceReleasePointSummary()
        {
            DataTable dtResult;

            raceReleasePoint = new BIZ.RaceReleasePoint();
            GetControlValue();
            PopulateBusinessLayer(Common.Common.RaceEntryClassType.RaceReleasePoint);
            dtResult = raceReleasePoint.RaceReleasePointSummary();

            if (dtResult.Rows.Count > 0)
            {
                frmBirdEntryMasterlist releasePointSummary = new frmBirdEntryMasterlist();
                releasePointSummary.RaceReleasePointData = RaceReleasePointData;
                releasePointSummary.ReleasePointSummary  = dtResult;
                releasePointSummary.ClubID             = ClubID;
                releasePointSummary.UserID             = UserID;
                releasePointSummary.RaceReleasePointID = RaceReleasePointID;
                releasePointSummary.ShowDialog();
            }
        }
예제 #7
0
 private void ReleasePointDelete()
 {
     try
     {
         raceReleasePoint = new BIZ.RaceReleasePoint();
         GetControlValue();
         if (RaceScheduleDetailsID > 0)
         {
             if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes))
             {
                 PopulateBussinessLayer(Common.Common.RaceEntryClassType.RaceReleasePoint);
                 raceReleasePoint.RaceReleasePointDelete();
                 ClearControl();
                 ReleasePointSelectAll();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
예제 #8
0
 private void GetLocationCategory()
 {
     try
     {
         if (cmbLocationName.Text != "")
         {
             DataTable dtResult;
             raceReleasePoint = new BIZ.RaceReleasePoint();
             GetControlValue();
             PopulateBussinessLayer(Common.Common.RaceEntryClassType.RaceReleasePoint);
             dtResult = raceReleasePoint.RaceReleasePointGetLocation();
             if (dtResult.Rows.Count > 0)
             {
                 RecordSearched = dtResult;
                 PopulateControl();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
예제 #9
0
        private void GetReleasePoint()
        {
            try
            {
                raceReleasePoint = new BIZ.RaceReleasePoint();
                GetControlValue();
                PopulateBusinessLayer(Common.Common.RaceEntryClassType.RaceReleasePoint);

                //Race Schedule
                DataTable dtRaceScheduleCategory;
                dtRaceScheduleCategory    = raceReleasePoint.RaceReleasePointGetbyRaceScheduleCategory();
                dtReleasePoint.DataSource = dtRaceScheduleCategory;

                if (dtRaceScheduleCategory.Rows.Count > 0)
                {
                    dtReleasePoint.Columns[0].Visible = false;
                    dtReleasePoint.Columns[1].Visible = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }
예제 #10
0
        private void grid_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DataGridView datagrid = this.dataGridView1;
                Int64        index;
                String       time = "";
                String[]     hm;

                if (datagrid.RowCount > 0)
                {
                    raceReleasePoint = new BIZ.RaceReleasePoint();
                    index            = datagrid.CurrentRow.Index;
                    if ((string)datagrid.CurrentCell.Value.ToString() == "EDIT")
                    {
                        LocationName = Convert.ToString(((DateTime)datagrid.Rows[Convert.ToInt32(index)].Cells[9].Value).ToShortDateString()) + " | " + Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[7].Value);
                        if (LocationName != "")
                        {
                            this.cmbLocationName.SelectedItem = LocationName;
                            this.txtReleasePointID.Text       = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[0].Value);
                            this.cmbMinSpeed.Text             = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[1].Value);
                            this.chkIsStop.Checked            = Convert.ToBoolean(datagrid.Rows[Convert.ToInt32(index)].Cells[2].Value);
                            if (chkIsStop.Checked)
                            {
                                this.dtpStopFromDate.Value = Common.Common.ConvertDate(datagrid.Rows[Convert.ToInt32(index)].Cells[3].Value.ToString());
                                this.txtStopFromTime.Text  = datagrid.Rows[Convert.ToInt32(index)].Cells[4].Value.ToString();
                                this.dtpStopToDate.Value   = Common.Common.ConvertDate(datagrid.Rows[Convert.ToInt32(index)].Cells[5].Value.ToString());
                                this.txtStopToTime.Text    = datagrid.Rows[Convert.ToInt32(index)].Cells[6].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 = Common.Common.ConvertDate(datagrid.Rows[Convert.ToInt32(index)].Cells[9].Value.ToString());
                            time = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[10].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 = "";
                            }
                            this.txtMultiplier.Text = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[11].Value);
                            this.txtLapNo.Text      = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[12].Value);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }