Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                BIZ.RaceResult raceresult = new BIZ.RaceResult();
                DataSet        dtresult   = new DataSet();
                raceresult.StickerCode = txtStickerCode.Text;
                dtresult = raceresult.GetSticker();
                if (dtresult.Tables.Count > 0)
                {
                    if (dtresult.Tables[0].Rows.Count > 0)
                    {
                        StickerNumber = dtresult.Tables[0].Rows[0]["FullStickerNo"].ToString();
                        this.Close();
                    }
                }

                if (string.IsNullOrEmpty(StickerNumber))
                {
                    MessageBox.Show("Invalid Sticker Code. No record found.", "No Record");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet dtResult = new DataSet();

            BIZ.RaceResult raceResult = new BIZ.RaceResult();
            raceResult.ReleasedDate = dateTimePicker1.Value.Date;
            dtResult = raceResult.ViewClubRace();
            if (dtResult.Tables.Count > 0)
            {
                dataGridView1.DataSource = dtResult.Tables[0];
            }
        }
Exemple #3
0
        private void ViewResult()
        {
            try
            {
                DataSet dtResult = new DataSet();
                raceResult = new BIZ.RaceResult();
                String version = "";

                ClearControl();
                GetControlValue();
                PopulateBusinessLayer(Common.Common.RaceResult.RaceResult);
                dtResult = raceResult.RaceResultGetByKey();
                if (dtResult.Tables.Count > 0)
                {
                    if (dtResult.Tables[0].Rows.Count > 0)
                    {
                        lblLocation.Text           = dtResult.Tables[0].Rows[0]["LocationName"].ToString();
                        lblCorrdinates.Text        = dtResult.Tables[0].Rows[0]["Coordinates"].ToString();
                        lblLap.Text                = dtResult.Tables[0].Rows[0]["Lap"].ToString();
                        lblTotalBirds.Text         = dtResult.Tables[0].Rows[0]["TotalBird"].ToString();
                        lblTotalSMSCount.Text      = dtResult.Tables[0].Rows[0]["SMSCount"].ToString();
                        lblClockingPercentage.Text = "0 %";
                        if (lblTotalBirds.Text != "0" && lblTotalBirds.Text != "" && lblTotalSMSCount.Text != "")
                        {
                            lblClockingPercentage.Text = Convert.ToString(Math.Round(Convert.ToDecimal(Decimal.Parse(lblTotalSMSCount.Text) / Decimal.Parse(lblTotalBirds.Text) * 100), 2)) + " %";
                        }
                        version = dtResult.Tables[0].Rows[0]["Version"].ToString();
                    }

                    this.dataGridView1.DataSource = dtResult.Tables[1];
                    if (version != "1")
                    {
                        if (dtResult.Tables[1].Rows.Count > 0)
                        {
                            dataGridView1.Columns[6].DefaultCellStyle.Format = "MM/dd/yyyy HH:mm:ss";
                            //dataGridView1.Columns[2].DefaultCellStyle.Format = "#,##0.00";
                            dataGridView1.Columns[2].DefaultCellStyle.Format = "#,##0.00";
                            dataGridView1.Columns[3].DefaultCellStyle.Format = "#,##0.00";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }
Exemple #4
0
        private void AddRaceResultFromBackup(string source)
        {
            try
            {
                BIZ.RaceResult raceresult = new BIZ.RaceResult();
                raceresult.ClubID       = ClubID;
                raceresult.StickerCode  = txtStickerCode.Text;
                raceresult.ReleasedDate = DateRelease;
                raceresult.Sender       = txtSender.Text;
                raceresult.Arrival      = dtArrivalDate.Value.Date.ToShortDateString() + " " + txtArrivalTime.Text;
                raceresult.RaceResultAddFromBackup(source);
                MessageBox.Show("Race result save.");

                txtStickerCode.Text = "";
                txtArrivalTime.Text = "";
                txtArrivalTime.Focus();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #5
0
 private void grid_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         DataGridView datagrid = this.dataGridView1;
         Int64        index;
         Int64        colIndex;
         String       value = "";
         if (datagrid.RowCount > 0)
         {
             raceResult = new BIZ.RaceResult();
             index      = datagrid.CurrentRow.Index;
             colIndex   = datagrid.CurrentCell.ColumnIndex;
             value      = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[10].Value);
             if (value.ToUpper() == "DELETE")
             {
                 StickerCode = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[5].Value);
                 PigeonID    = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[4].Value);
                 if (StickerCode != "")
                 {
                     if (MessageBox.Show("Are you sure you would like to delete this transaction?", "Delete Record", MessageBoxButtons.YesNo) == DialogResult.Yes)
                     {
                         raceResult.ClubID      = ClubID;
                         raceResult.PigeonID    = PigeonID;
                         raceResult.StickerCode = StickerCode;
                         raceResult.RaceResultDelete();
                         MessageBox.Show("Race result succesfully deleted", "Delete Record");
                         ViewResult();
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Exemple #6
0
 private void ViewResult()
 {
     try
     {
         DataSet dtResult = new DataSet();
         raceResults = new BIZ.RaceResult();
         ClearControl();
         GetControlValue();
         PopulateBusinessLayer(Common.Common.RaceResult.RaceResult);
         dtResult = raceResults.RaceResultGetByScheduleCategory();
         if (dtResult.Tables.Count > 0)
         {
             this.dataGridView1.DataSource    = dtResult.Tables[0];
             dataGridView1.Columns[0].Visible = false;
             dataGridView1.Columns[1].Visible = false;
             dataGridView1.Columns[2].Visible = false;
             dataGridView1.Columns[3].Visible = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error");
     }
 }