Beispiel #1
0
 private void AuthenticateUser()
 {
     if (txt_userid.Text == "" && txt_password.Text == "")
     {
         auth = false;
         MessageBox.Show("Please enter User Name/Password!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         //this.DialogResult = DialogResult.OK;
     }
     else
     {
         if (txt_userid.Text.Trim().Length > 0 && txt_password.Text.Trim().Length > 0)
         {
             string Query = "SELECT COUNT(*) from Client_login where user_name = '" + txt_userid.Text.Trim() + "' and password = '******'";
             int    Count = new LoginManager().GetCount(Query);
             if (Count > 0)
             {
                 auth = true;
                 this.DialogResult = DialogResult.OK;
                 Personal_Details pd = new Personal_Details();
                 pd.Show();
                 this.Hide();
             }
             else
             {
                 auth = false;
                 MessageBox.Show("Invalid User Name/Password!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 txt_userid.Focus();
             }
         }
     }
 }
Beispiel #2
0
        private void dgv_order_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1 && e.ColumnIndex > -1)
            {
                string txtval = txt_searchfield.Text;
                if (order == null)
                    order = new Order();


                order.CustomerId = new OrderManager().GetCustId(cb_search.SelectedItem.ToString(), txtval);

                //Edit
                if (e.ColumnIndex == 0)
                {
                    Personal_Details pd = new Personal_Details();
                    pd.UpdateCustomer(order.CustomerId);
                    pd.UpdateOrder(order.CustomerId);
                    pd.ShowDialog();

                } //Delete
                else if (e.ColumnIndex == 1)
                {

                }
            }
        }
Beispiel #3
0
        private void dgv_order_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1 && e.ColumnIndex > -1)
            {
                string txtval = txt_searchfield.Text;
                if (order == null)
                {
                    order = new Order();
                }


                order.CustomerId = new OrderManager().GetCustId(cb_search.SelectedItem.ToString(), txtval);

                //Edit
                if (e.ColumnIndex == 0)
                {
                    Personal_Details pd = new Personal_Details();
                    pd.UpdateCustomer(order.CustomerId);
                    pd.UpdateOrder(order.CustomerId);
                    pd.ShowDialog();
                } //Delete
                else if (e.ColumnIndex == 1)
                {
                }
            }
        }
Beispiel #4
0
        private void AuthenticateUser()
        {
            if (txt_userid.Text == "" && txt_password.Text == "")
            {
                auth = false;
                MessageBox.Show("Please enter User Name/Password!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //this.DialogResult = DialogResult.OK;


            }
            else
            {
                if (txt_userid.Text.Trim().Length > 0 && txt_password.Text.Trim().Length > 0)
                {
                    string Query = "SELECT COUNT(*) from Client_login where user_name = '" + txt_userid.Text.Trim() + "' and password = '******'";
                    int Count = new LoginManager().GetCount(Query);
                    if (Count > 0)
                    {
                        auth = true;
                        this.DialogResult = DialogResult.OK;
                        Personal_Details pd = new Personal_Details();
                        pd.Show();
                        this.Hide();
                    }
                    else
                    {
                        auth = false;
                        MessageBox.Show("Invalid User Name/Password!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        txt_userid.Focus();
                    }
                }


            }

        }