Exemplo n.º 1
0
        private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
        {
            this.Dispose();
            mntForm mnt = new mntForm();

            mnt.Show();
        }
        private void lblEmp_MouseClick(object sender, MouseEventArgs e)
        {
            mntForm f1 = new mntForm();

            f1.Show();
            Hide();
        }
Exemplo n.º 3
0
        private void lblSubmit_MouseClick(object sender, MouseEventArgs e)
        {
            if (txtNIC.Text == "" || dropdPos.Text == "" || txtfName.Text == "" || txtlName.Text == "" || datetimeBD.Text == "" || txtAddressNo.Text == "" || txtAddressCity.Text == "" || txtAddressStreet.Text == "" || txtTele.Text == "" || txtEmail.Text == "" || photoBox.Image == null)
            {
                MessageBox.Show("Please Fill all the Details");
            }
            else
            {
                try
                {
                    //validatenow();

                    //MessageBox.Show(lblID.Text);
                    string query = ("update Employee set EmpNIC = '" + txtNIC.Text
                                    + "', EmpfName = '" + txtfName.Text
                                    + "', EmplName = '" + txtlName.Text
                                    + "', Position = '" + dropdPos.Text.ToString()
                                    + "', DOB = '" + datetimeBD.Value.ToString()
                                    + "', Email = '" + txtEmail.Text
                                    + "', ContactNo = '" + txtTele.Text
                                    + "', No = '" + txtAddressNo.Text
                                    + "', Street = '" + txtAddressStreet.Text
                                    + "', City = '" + txtAddressCity.Text
                                    + "', Photo = '" + realname
                                    + "' where EmpID = '" + lblID.Text.ToString() + "' ");

                    int h = conn.executeQry(query);
                    if (h == 1)
                    {
                        System.IO.File.Copy(FileName, @"C:\Users\House MoNaRa\Documents\Visual Studio 2015\Projects\EmployeeM\EmployeeM\Images\" + realname);
                    }

                    conn.closeConnection();

                    mntForm hh = ((mntForm)container);
                    hh.Enabled = true;
                    hh.tbl.loadFirstPage();

                    resetData();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemplo n.º 4
0
        private void lblSubmit_MouseClick(object sender, MouseEventArgs e)
        {
            if (txtNIC.Text == "" || dropdPos.Text == "" || txtfName.Text == "" || txtlName.Text == "" || datetimeBD.Text == "" || txtAddressNo.Text == "" || txtAddressCity.Text == "" || txtAddressStreet.Text == "" || txtTele.Text == "" || txtEmail.Text == "" || photoBox.Image == null)
            {
                MessageBox.Show("Please Fill all the Details");
            }
            else
            {
                try
                {
                    //validatenow();

                    System.IO.File.Copy(FileName, @"C:\Users\House MoNaRa\Documents\Visual Studio 2015\Projects\EmployeeM\EmployeeM\Images\" + realname);

                    string query = "insert into Employee (EmpNIC,EmpfName,EmplName,JoinDate,Position,DOB,Email,No,Street,City,Photo,ContactNo) values ('"
                                   + txtNIC.Text + "','" + txtfName.Text + "','" + txtlName.Text + "','" + DateTime.Now + "','" + dropdPos.Text.ToString() + "','"
                                   + datetimeBD.Value.ToString() + "','" + txtEmail.Text + "','" + txtAddressNo.Text + "','" + txtAddressStreet.Text + "','"
                                   + txtAddressCity.Text + "','" + realname + "','" + txtTele.Text + "')";


                    conn.executeQry(query);

                    conn.closeConnection();

                    resetData();
                    mntForm hh = ((mntForm)container);
                    hh.Enabled = true;
                    hh.tbl.loadFirstPage();
                    hh.tbl.QuickGo();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }