private void btnSearch_Click(object sender, EventArgs e)
        {
            DataTable dtSearchResult = new DataTable();
            Boolean   flag           = false;

            if (txtEmpNo.Text.Equals(""))
            {
                MessageBox.Show("Enter Employee Number to search");
            }
            else
            {
                dtSearchResult = dbAccessLayer.RetrieveTable("tblempmaster", new String[] { "EmpNo" }, new String[] { txtEmpNo.Text });
            }

            if (dtSearchResult != null)
            {
                if (dtSearchResult.Rows.Count > 0)
                {
                    txtEmpNo.Text = dtSearchResult.Rows[0][0].ToString();

                    txtEmpName.Text             = dtSearchResult.Rows[0][1].ToString();
                    cmbBoxEmpType.SelectedValue = dtSearchResult.Rows[0][2].ToString();
                    cmbBoxEmpDept.SelectedValue = dtSearchResult.Rows[0][3].ToString();
                    cmbBoxShip.SelectedValue    = dtSearchResult.Rows[0][4].ToString();
                    if (Boolean.Parse(dtSearchResult.Rows [0][5].ToString()))
                    {
                        rdBtnActive.Checked = true;
                    }
                    else
                    {
                        rdBtnInactive.Checked = true;
                    }
                    txtFromDate.Text = dtSearchResult.Rows[0][6].ToString();
                    txtToDate.Text   = dtSearchResult.Rows[0][7].ToString();
                    txtPassWord.Text = dtSearchResult.Rows[0][8].ToString();
                    flag             = true;
                }
                else
                {
                    flag = false;
                }
            }
            else
            {
                flag = false;
            }

            if (!flag)
            {
                MessageBox.Show("No results found");
            }
        }
Example #2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            DataTable dtSearchResult = new DataTable();
            Boolean   flag           = false;

            if (txtShipNo.Text.Equals(""))
            {
                MessageBox.Show("Enter Ship Number to search");
            }
            else
            {
                dtSearchResult = dbAccessLayer.RetrieveTable("tblshipmaster", new String[] { "ShipNo" }, new String[] { txtShipNo.Text });
            }

            if (dtSearchResult != null)
            {
                if (dtSearchResult.Rows.Count > 0)
                {
                    txtShipNo.Text = dtSearchResult.Rows[0][0].ToString();

                    txtShipName.Text             = dtSearchResult.Rows[0][1].ToString();
                    cmbBoxFleet.SelectedValue    = dtSearchResult.Rows[0][2].ToString();
                    cmbBoxShipType.SelectedValue = dtSearchResult.Rows[0][3].ToString();
                    txtShipSize.Text             = dtSearchResult.Rows[0][4].ToString();
                    txtShipCapacity.Text         = dtSearchResult.Rows[0][5].ToString();
                    flag = true;
                }
                else
                {
                    flag = false;
                }
            }
            else
            {
                flag = false;
            }

            if (!flag)
            {
                MessageBox.Show("No results found");
            }
        }
Example #3
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            DataTable dtSearchResult = new DataTable();
            Boolean   flag           = false;

            if (txtShipTypeID.Text.Equals(""))
            {
                MessageBox.Show("Enter Ship Id to search");
            }
            else
            {
                dtSearchResult = dbAccessLayer.RetrieveTable("tblshiptypemaster", new String[] { "ShiptypeID" }, new String[] { txtShipTypeID.Text });
            }

            if (dtSearchResult != null)
            {
                if (dtSearchResult.Rows.Count > 0)
                {
                    txtShipTypeID.Text = dtSearchResult.Rows[0][0].ToString();

                    txtShipTypeName.Text = dtSearchResult.Rows[0][1].ToString();

                    txtShipTypeDesc.Text = dtSearchResult.Rows[0][2].ToString();
                    flag = true;
                }
                else
                {
                    flag = false;
                }
            }
            else
            {
                flag = false;
            }

            if (!flag)
            {
                MessageBox.Show("No results found");
            }
        }