Exemple #1
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            frmBill frm = new Forms.frmBill();

            frm.Show();
            this.Hide();
        }
Exemple #2
0
        private void kdvequipcon_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            frmBill select = new Forms.frmBill();

            select.txtbid.Text             = kdvequipcon.CurrentRow.Cells [0].Value.ToString();
            select.cmbxrcid.Text           = kdvequipcon.CurrentRow.Cells [1].Value.ToString();
            select.txtqid.Text             = kdvequipcon.CurrentRow.Cells [2].Value.ToString();
            select.txtrid.Text             = kdvequipcon.CurrentRow.Cells [3].Value.ToString();
            select.txtequipmentid.Text     = kdvequipcon.CurrentRow.Cells [4].Value.ToString();
            select.txtequipmentname.Text   = kdvequipcon.CurrentRow.Cells [5].Value.ToString();
            select.txtequipmentserial.Text = kdvequipcon.CurrentRow.Cells [6].Value.ToString();
            select.txtclientname.Text      = kdvequipcon.CurrentRow.Cells [7].Value.ToString();
            select.txtclientemail.Text     = kdvequipcon.CurrentRow.Cells [8].Value.ToString();
            select.txtreportedproblem.Text = kdvequipcon.CurrentRow.Cells [9].Value.ToString();
            select.txtdiagnosisdone.Text   = kdvequipcon.CurrentRow.Cells [10].Value.ToString();
            select.txthditems.Text         = kdvequipcon.CurrentRow.Cells [11].Value.ToString();
            select.txtsftitems.Text        = kdvequipcon.CurrentRow.Cells [12].Value.ToString();
            select.txthwserial.Text        = kdvequipcon.CurrentRow.Cells [13].Value.ToString();
            select.cmbxstatus.Text         = kdvequipcon.CurrentRow.Cells [14].Value.ToString();
            select.cmbxassignedtech.Text   = kdvequipcon.CurrentRow.Cells [15].Value.ToString();
            select.cmbxtechsum.Text        = kdvequipcon.CurrentRow.Cells [16].Value.ToString();
            select.txtnotes.Text           = kdvequipcon.CurrentRow.Cells [17].Value.ToString();
            select.txtqamnt.Text           = kdvequipcon.CurrentRow.Cells [18].Value.ToString();
            select.txttaxrate.Text         = kdvequipcon.CurrentRow.Cells [19].Value.ToString();
            select.txttxamnt.Text          = kdvequipcon.CurrentRow.Cells [20].Value.ToString();
            select.txtgamnt.Text           = kdvequipcon.CurrentRow.Cells [21].Value.ToString();
            select.txtpamnt.Text           = kdvequipcon.CurrentRow.Cells [22].Value.ToString();
            select.txtbalance.Text         = kdvequipcon.CurrentRow.Cells [23].Value.ToString();
            select.txtstatus.Text          = kdvequipcon.CurrentRow.Cells [24].Value.ToString();
            select.txtbilldate.Text        = kdvequipcon.CurrentRow.Cells [25].Value.ToString();
            select.txtdate.Text            = kdvequipcon.CurrentRow.Cells [26].Value.ToString();

            //keen ();
            select.ShowDialog();
            fillgrid();
            this.Close();
        }
        private void btnlogin_Click(object sender, EventArgs e)
        {
            try
            {
                string user = txtuser.Text;
                string pass = txtpass.Text;
                string role = cmbxrole.Text;
                // string role = string.Empty;
                if (user == "" || pass == "" || role == "")
                {
                    MetroFramework.MetroMessageBox.Show(this, "Empty Fields Detected ! Please fill up all the fields", "AJCS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtuser.Focus();
                    // MessageBox.Show ("Empty Fields Detected ! Please fill up all the fields");

                    return;
                }
                bool r = validate_login(user, pass, role);
                if (r)
                {// MessageBox.Show ("Correct Login Credentials");
                    if (role == "Accounts")
                    {
                        db_connection();
                        // role =  ["UserRole"].ToString ();
                        MySqlCommand cmd = new MySqlCommand();
                        cmd.CommandText = "Select empdesg from login where empdesg= 'Accounts' and stampvalue = '0'";
                        cmd.Parameters.AddWithValue("@user", user);
                        cmd.Parameters.AddWithValue("@pass", pass);
                        cmd.Connection = connect;

                        insertlogindate();
                        MetroFramework.MetroMessageBox.Show(this, txtuser.Text, "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        frmBill main = new Forms.frmBill();
                        main.Text = txtuser.Text;
                        main.Show();
                        this.Visible = false;
                    }
                }

                else
                {
                    insertlogindate();
                    MetroFramework.MetroMessageBox.Show(this, "Incorrect Login Credentials", "ATWS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    clear();
                    Counter          = Counter + 1;
                    txtcounters.Text = Counter.ToString();
                    s1 = Convert.ToString(3 - Counter);
                    if (Counter == 3)
                    {
                        updatelogactivity();

                        MetroFramework.MetroMessageBox.Show(this, "You have no more attempts left", "ATWS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        updatelogactivity();
                        Application.Exit();
                    }
                    //MessageBox.Show ("Incorrect Login Credentials");
                }
                connect.Close();
            }

            catch (Exception ex)
            {
                writeErrorLog(ex.Message);
            }
        }