private void button3_Click(object sender, EventArgs e) { string madv = comboBox1.Text.ToString(); string tendv = textBox1.Text.ToString(); string kyhan = textBox2.Text.ToString(); string laisuat = textBox3.Text.ToString(); string[] name = { "@MADV", "@TENDV", "@KYHAN", "@LAISUAT" }; object[] param = { madv, tendv, kyhan, laisuat }; int x = DBAcess.ExecuteNonQuery("SP_SUADICHVU", name, param, 4); if (x == 0) { MessageBox.Show("Sua dich vu thành công"); Capnhatdichvu_Load(sender, e); } if (x != 0) { MessageBox.Show("Sua dich vu thất bại"); } comboBox1.DataBindings.Clear(); textBox1.DataBindings.Clear(); textBox2.DataBindings.Clear(); textBox3.DataBindings.Clear(); }
private void button1_Click(object sender, EventArgs e) { if (textBox2.Text.Trim() == "" || textBox1.Text.Trim() == "" || textBox3.Text.Trim() == "") { MessageBox.Show("Mật khẩu phải chứa kí tự hoặc số. Không chứa khoảng trắng."); return; } if (textBox1.Text != textBox3.Text) { MessageBox.Show("New password phải giống confirm password"); return; } string[] name = { "@newpassword", "@oldpassword", "@login" }; object[] param = { textBox1.Text, textBox2.Text, DBAcess.USERNAME }; int x = DBAcess.ExecuteNonQuery("SP_DoiMatKhau", name, param, 3); if (x == 0) { MessageBox.Show("Đổi mật khẩu thành công"); this.Close(); } else { MessageBox.Show("Đổi mật khẩu thất bại"); } }
private void btnGhi_Click(object sender, EventArgs e) { try { /*Double value; * if (Double.TryParse(tongtienrutTBOX.Text, out value)) * tongtienrutTBOX.Text = String.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:C2}", value); * else * tongtienrutTBOX.Text = String.Empty; */ if (tongtienrutTBOX.Text.Length > 10) { MessageBox.Show("Số tiền rút tối đa chỉ là 1 tỷ"); } else { string maPH = comboBox1.SelectedItem.ToString(); string maGDV = magdvTBOX.Text.ToString(); /*DateTime ngRut = DateTime.Parse(dateTimePicker1.Value.ToString()); * dateTimePicker1.Text = ngRut.ToShortDateString();*/ /*string sotienGui = sotienguiTBOX.Text.ToString();*/ string tienlai = tienlaiTBOX.Text.ToString(); string sotienRut = tongtienrutTBOX.Text.ToString(); /* MessageBox.Show("toi day"); * string.Format("{#.0000}",sotienRut); * MessageBox.Show("toi day");*/ /*string sotienRut = String.Format("{0:C}", sotienRut);*/ string[] name = { "@MAPHIEU", "@MAGDV_LPRUT", "@TIENLAI", "@SOTIEN_RUT" }; object[] param = { maPH, maGDV, tienlai, sotienRut }; int x = DBAcess.ExecuteNonQuery("SP_THEMPHIEURUT", name, param, 4); if (x == 0) { MessageBox.Show("RUT TIEN THANH CONG"); tongtienrutTBOX.DataBindings.Clear(); tienlaiTBOX.DataBindings.Clear(); sotienguiTBOX.DataBindings.Clear(); } if (x != 0) { MessageBox.Show("TIEN BAN RUT QUA LON"); } } } catch { MessageBox.Show(" loi roi"); } }
private void button1_Click_1(object sender, EventArgs e) { int reinit = checkBox1.Checked ? 1 : 0; string[] name = { "@reinit" }; object[] param = { reinit }; int code = DBAcess.ExecuteNonQuery("SP_BACKUP", name, param, 1); if (code > 0) { MessageBox.Show("Sao lưu thành công"); } else { MessageBox.Show("Sao lưu thất bại."); } }
private void button1_Click(object sender, EventArgs e) { try { if (comboBox1.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == "" || nhanvienrRBTON.Checked == false && adminRBTON.Checked == false) { MessageBox.Show("ban chua nhập đầy đủ"); } else { string hoten = comboBox1.Text.ToString(); string diachi = textBox2.Text.ToString(); string cmndan = textBox3.Text.ToString(); string soDT = textBox4.Text.ToString(); string tenDnhap = textBox5.Text.ToString(); string mAtkhau = textBox6.Text.ToString(); string Role = getRole(); string[] name = { "@LGNAME", "@PASS", "@ROLE", "@HOTEN", "@DIACHI", "@CMND", "@SODT" }; object[] param = { tenDnhap, mAtkhau, Role, hoten, diachi, cmndan, soDT }; int x = DBAcess.ExecuteNonQuery("TAO_LOGIN", name, param, 7); comboBox1.Text = string.Empty; textBox2.Text = string.Empty; textBox3.Text = string.Empty; textBox4.Text = string.Empty; textBox5.Text = string.Empty; textBox6.Text = string.Empty; if (x == 0) { MessageBox.Show("TẠO TÀI KHÒAN" + Role + "THÀNH CÔNG"); } if (x != 0) { MessageBox.Show("Chưa tạo được tài khoản"); } } } catch { MessageBox.Show(" loi roi"); } }