示例#1
0
        private void Btn_Save_Click(object sender, EventArgs e)
        {
            Class_NewAccount modify = new Class_NewAccount();

            Tb_Username = null;
            Tb_Delete   = null;

            if (Tb_Username != null && Tb_Delete != null)
            {
                int modified = modify.ModifyDeleteAccount(Tb_Username.Text, Tb_fullname.Text, Tb_Address.Text, Tb_Phone.Text, Tb_Gender.Text, Tb_Department.Text, Tb_CompanyEmail.Text, Tb_Delete.Text, Tb_Adminusername.Text, Tb_AdminPassword.Text);

                if (modified == 1)
                {
                    Lbl_status.ForeColor = System.Drawing.Color.Green;
                    Lbl_status.Text      = "Changes were carried successfully!";
                }

                if (modified == 0)
                {
                    Lbl_status.ForeColor = System.Drawing.Color.Red;
                    Lbl_status.Text      = "Something went wrong, please re-do the work!";
                }
            }

            if (Tb_Username == null && Tb_Delete != null)
            {
                int modified = modify.DeleteAccount(Tb_Delete.Text, Tb_Adminusername.Text, Tb_AdminPassword.Text);

                if (modified == 1)
                {
                    Lbl_status.ForeColor = System.Drawing.Color.Green;
                    Lbl_status.Text      = "Changes were carried successfully!";
                }

                if (modified == 0)
                {
                    Lbl_status.ForeColor = System.Drawing.Color.Red;
                    Lbl_status.Text      = "Something went wrong, please re-do the work!";
                }
            }

            if (Tb_Username != null && Tb_Delete == null)
            {
                int modified = modify.ModifyAccount(Tb_Username.Text, Tb_fullname.Text, Tb_Address.Text, Tb_Phone.Text, Tb_Gender.Text, Tb_Department.Text, Tb_CompanyEmail.Text, Tb_Adminusername.Text, Tb_AdminPassword.Text);

                if (modified == 1)
                {
                    Lbl_status.ForeColor = System.Drawing.Color.Green;
                    Lbl_status.Text      = "Changes were carried successfully!";
                }

                if (modified == 0)
                {
                    Lbl_status.ForeColor = System.Drawing.Color.Red;
                    Lbl_status.Text      = "Something went wrong, please re-do the work!";
                }
            }
        }
示例#2
0
        private void Btn_Create_Click(object sender, EventArgs e)
        {
            if (status is null)
            {
                MessageBox.Show("Please check availability...");
            }

            else
            {
                Class_NewAccount newacc = new Class_NewAccount();
                int CustomerNewAccount  = newacc.CustomerNewAccount(tb_fullname.Text, Rbtn_Male.Checked, tb_phone.Text, tb_address.Text, Tb_Username.Text, tb_password.Text, Tb_Email.Text);

                if (CustomerNewAccount != 0)
                {
                    MessageBox.Show("Your account was Created successfully!");
                    Form_Login forwardtologin = new Form_Login();
                    this.Close();
                    forwardtologin.Show();
                }
            }
        }
        private void Btn_Create_Click(object sender, EventArgs e)
        {
            if (status is null)
            {
                MessageBox.Show("Please check availability...");
            }

            else
            {
                Class_NewAccount newaccount = new Class_NewAccount();
                int EmployeeNewAccount      = newaccount.EmployeeNewAccount(Tb_Fullname.Text, Rbtn_Male.Checked, Tb_Phone.Text, Tb_Address.Text, Tb_Username.Text, Tb_Password.Text, Tb_Email.Text, Tb_Department.Text);

                if (EmployeeNewAccount != 0)
                {
                    MessageBox.Show("Your account was Created successfully!");
                    EmployeeHomepage forwardtoemp = new EmployeeHomepage();
                    this.Close();
                    forwardtoemp.Show();
                }
            }
        }