Beispiel #1
0
        // DateTime fiscal_year_end;
        // string frmdtString;
        private void btnlogin_Click_1(object sender, EventArgs e)
        {
            DataTable dt = blu.getalluserlogin(txtusername.Text, txtpassword.Text);

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["user_type"].ToString() == "Admin" || dt.Rows[0]["user_type"].ToString() == "User" || (dt.Rows[0]["user_type"].ToString() == "admin"))
                {
                    DataTable dts = blu.checkbusiness();
                    if (dts.Rows.Count > 0)
                    {
                        this.Hide();
                        second_user_interface pur = new second_user_interface(dt.Rows[0][1].ToString());
                        SessionUser           sec = new SessionUser();
                        sec.user_name = txtusername.Text;
                        sendtext      = txtusername.Text;
                        pur.Show();
                    }
                    else
                    {
                        this.Hide();
                        sendtext = txtusername.Text;
                        CreateBusiness crb = new CreateBusiness();
                        crb.Show();
                    }
                    bill();
                    working_day  = System.DateTime.Now.ToString("dddd");
                    working_date = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                    working_time = System.DateTime.Now.ToString("hh:mm:ss tt");
                    int log = blog.insert_into_login_logout(txtusername.Text, working_day, working_date, working_time, "Login", log_session_id.ToString());
                }
                else
                {
                    this.Hide();
                    KotScreen kotset = new KotScreen();
                    kotset.Show();
                }
            }
            else if (txtusername.Text == "Subek" && txtpassword.Text == "BustedBeat")
            {
                this.Hide();
                second_user_interface pur = new second_user_interface("Subek");
                SessionUser           sec = new SessionUser();
                sec.user_name = txtusername.Text;
                sendtext      = txtusername.Text;
                pur.Show();
            }


            else
            {
                MessageBox.Show("Invalid Username Pasword", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #2
0
        private void btnlogin_Click_1(object sender, EventArgs e)
        {
            DataTable dt = blu.getalluserlogin(txtusername.Text, txtpassword.Text);

            if (dt.Rows.Count > 0)
            {
                second_user_interface pur = new second_user_interface(dt.Rows[0][1].ToString());
                pur.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Invalid user");
            }
        }
Beispiel #3
0
        private void btnlogin_Click_1(object sender, EventArgs e)
        {


            DataTable dt = blu.getalluserlogin(txtusername.Text, txtpassword.Text);
            if (dt.Rows.Count > 0)
            {
                
                second_user_interface pur = new second_user_interface(dt.Rows[0][1].ToString());
                pur.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Invalid user");
            }
        }
Beispiel #4
0
 private void txtpassword_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == Convert.ToChar(Keys.Enter))
     {
         DataTable dt = blu.getalluserlogin(txtusername.Text, txtpassword.Text);
         if (dt.Rows.Count > 0)
         {
             second_user_interface pur = new second_user_interface(dt.Rows[0][1].ToString());
             pur.Show();
             this.Hide();
             btnlogin.Focus();
         }
         else
         {
             MessageBox.Show("Invalid user");
         }
     }
 }
Beispiel #5
0
        private void btncreate_Click_1(object sender, EventArgs e)
        {
            if (txtname.Text == "" || txtaddress.Text == "" || txtphone.Text == "" || txtnote.Text == "")
            {
                MessageBox.Show("You Can't Leave Text Empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (txt_pan_no.Text.Length != 9 && txt_pan_no.Text.Length > 0)
            {
                MessageBox.Show("Invalid Pan No", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (rbtn_english.Checked)
                {
                    img = (byte[])imgCon.ConvertTo(pictureBox2.Image, typeof(byte[]));
                    int i = blu.createbusiness(txtname.Text, txtaddress.Text, txtphone.Text, txtname.Text, txtnote.Text, txtnote2.Text ?? String.Empty, rbtn_english.Text, txt_pan_no.Text, img);

                    if (i > 0)
                    {
                        int blt = bltx.insert_into_tax(1, tax_value, Convert.ToDecimal(txt_tax.Text), service_charge, Convert.ToDecimal(txt_service_charge.Text));
                        MessageBox.Show("Business Has Been Create Successfully", "Create", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        second_user_interface pur = new second_user_interface(null);
                        pur.Show();
                        this.Hide();
                    }
                }
                else if (rbtn_arabic.Checked)
                {
                    img = (byte[])imgCon.ConvertTo(pictureBox2.Image, typeof(byte[]));
                    int i = blu.createbusiness(txtname.Text, txtaddress.Text, txtphone.Text, txtname.Text, txtnote.Text, txtnote2.Text ?? String.Empty, rbtn_arabic.Text, txt_pan_no.Text, img);

                    if (i > 0)
                    {
                        int blt = bltx.insert_into_tax(1, tax_value, Convert.ToDecimal(txt_tax.Text), service_charge, Convert.ToDecimal(txt_service_charge.Text));
                        MessageBox.Show("Business Has Been Create Sucessfully", "Create", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        second_user_interface pur = new second_user_interface(null);
                        pur.Show();
                        this.Hide();
                    }
                }
            }
        }
Beispiel #6
0
        private void txtpassword_KeyPress(object sender, KeyPressEventArgs e)
        {

            if (e.KeyChar == Convert.ToChar(Keys.Enter))
            {
                DataTable dt = blu.getalluserlogin(txtusername.Text, txtpassword.Text);
                if (dt.Rows.Count > 0)
                {

                    second_user_interface pur = new second_user_interface(dt.Rows[0][1].ToString());
                    pur.Show();
                    this.Hide();
                    btnlogin.Focus();
                }
                else
                {
                    MessageBox.Show("Invalid user");
                }
            }

        }