예제 #1
0
        private void btnView_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsResult = new DataSet();
                BizEntry = new BIZ.Entry();
                BizEntry = PopulateEntryBizLayer(BizEntry);
                dsResult = BizEntry.GetReleasePointDetails();

                if (dsResult.Tables.Count > 0)
                {
                    if (dsResult.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = dsResult.Tables[0].Rows[0];
                        lblLiberationPoint.Text = dr["LocationName"].ToString();
                        lblReleaseDate.Text     = dr["DateRelease"].ToString();
                        lblCoordinates.Text     = dr["Coordinates"].ToString();
                        lblEclockEntry.Text     = dr["TotalEntry"].ToString();
                        RaceReleasePointID      = (Int64)dr["RaceReleasePointID"];
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(BIZ.Common.CustomError(ex.Message), "Error");
            }
        }
예제 #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (Isverified)
         {
             BizEntry = new BIZ.Entry();
             BizEntry = PopulateEntryBizLayer(BizEntry);
             if (BizEntry.Save())
             {
                 MessageBox.Show("Entry saving success.");
                 PopulateDataGrid();
                 Clear();
             }
             else
             {
                 MessageBox.Show("Entry saving failed.", "Error");
             }
         }
         else
         {
             MessageBox.Show("RFID not verified.", "Error");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(BIZ.Common.CustomError(ex.Message), "Error");
     }
 }
예제 #3
0
        private void btnVerifyRFID_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsResult = new DataSet();
                BizEntry = new BIZ.Entry();
                BizEntry = PopulateEntryBizLayer(BizEntry);
                dsResult = BizEntry.VerifyRFID();

                if (dsResult.Tables.Count > 0)
                {
                    if (dsResult.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = dsResult.Tables[0].Rows[0];
                        txtBandNumber.Text   = dr["BandNumber"].ToString();
                        BandID               = (Int64)dr["BandID"];
                        MemberRFIDRegisterID = (Int64)dr["ID"];
                        Isverified           = true;
                    }
                }
                else
                {
                    MessageBox.Show("RFID is not register.");
                    Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(BIZ.Common.CustomError(ex.Message), "Error");
            }
        }
예제 #4
0
 private BIZ.Entry PopulateEntryBizLayer(BIZ.Entry bizData)
 {
     try
     {
         bizData.ClubID      = this.ClubID;
         bizData.ReleaseDate = Convert.ToDateTime(txtReleaseDate.Text);
         bizData.MemberID    = this.MemberID;
         return(bizData);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #5
0
 private void PopulateDataGrid()
 {
     try
     {
         DataTable dt = new DataTable();
         BizEntry = new BIZ.Entry();
         BizEntry = PopulateEntryBizLayer(BizEntry);
         dt       = BizEntry.GetMemberEclockEntry().Tables[0];
         this.dataGridView1.DataSource         = dt;
         this.lblTotalEntry.Text               = "Total : " + dt.Rows.Count.ToString();
         this.dataGridView1.Columns[0].Visible = false;
         this.dataGridView1.Columns[1].Visible = false;
         this.dataGridView1.Columns[2].Visible = false;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #6
0
 private void Delete()
 {
     try
     {
         if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes))
         {
             BizEntry = new BIZ.Entry();
             BizEntry = PopulateEntryBizLayer(BizEntry);
             if (BizEntry.Delete())
             {
                 MessageBox.Show("Eclock entry deleted.");
             }
             PopulateDataGrid();
             Clear();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #7
0
        private void btnGetRaceInfo_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsResult = new DataSet();
                BizEntry = new BIZ.Entry();
                BizEntry = PopulateEntryBizLayer(BizEntry);
                dsResult = BizEntry.GetReleasePointDetails();

                if (dsResult.Tables.Count > 0)
                {
                    if (dsResult.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = dsResult.Tables[0].Rows[0];
                        txtMinimumSpeed.Text = dr["MinSpeed"].ToString();
                        txtReleaseTime.Text  = "NOT RELEASE";
                        if (dr["ReleaseTime"].ToString() != "")
                        {
                            txtReleaseTime.Text = dr["ReleaseTime"].ToString();
                        }
                        txtStopTimeFrom.Text     = dr["StopTimeFrom"].ToString();
                        txtStopTimeTo.Text       = dr["StopTimeTo"].ToString();
                        txtCutoff.Text           = dr["CutOff"].ToString();
                        txtDistance.Text         = dr["Distance"].ToString();
                        txtNoOfEntry.Text        = dr["TotalEntry"].ToString();
                        txtEclockRaceResult.Text = dr["TotalEclockResult"].ToString();
                        txtTotalSMSClock.Text    = dr["TotalSMSResult"].ToString();
                        RaceReleasePointID       = (Int64)dr["RaceReleasePointID"];
                        GetRaceInfo = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(BIZ.Common.CustomError(ex.Message), "Error");
            }
        }
예제 #8
0
 private BIZ.Entry PopulateEntryBizLayer(BIZ.Entry bizData)
 {
     try
     {
         bizData.ClubID               = Parent.ClubID;
         bizData.ReleaseDate          = dtpReleasePoint.Value;
         bizData.RFIDSerialNo         = txtRFID.Text;
         bizData.ReleasepointID       = RaceReleasePointID;
         bizData.BandID               = BandID;
         bizData.BandNumber           = txtBandNumber.Text;
         bizData.MemberRFIDRegisterID = MemberRFIDRegisterID;
         bizData.EclockEntryID        = EclockEntryID;
         bizData.MemberID             = 0;
         if (txtMemberID.Text != "")
         {
             bizData.MemberID = Convert.ToInt64(txtMemberID.Text);
         }
         return(bizData);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }