private void ExecuteProcedure(int flag) { string[] Paras = new string[] { "@flag", "@ID", "@Username", "@Password", "@Showname" }; string[] Values = new string[] { flag.ToString(), MaUser.ToString(), txtUsername.Text.Trim(), txtPassword.Text.Trim(), txtShowname.Text.Trim() }; int kq = 0; try { kq = cls.ExecuteSP("spUsers", Paras, Values); if (kq > 0) { //MessageBox.Show("OK!"); } else { MessageBox.Show("Error!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Execute(int flag) { string[] Paras = new string[] { "@flag", "@MaHoSo", "@MaBienDong", "@NgayBienDong", "@LoaiBienDong", "@NoiDung" }; string[] Values = new string[] { flag.ToString(), txtMaHoSo.Text.Trim(), txtMaBienDong.Text.Trim(), dtpNgayBienDong.Value.ToString(), cmbLoaiBienDong.Text.Trim(), rtbNoiDung.Text.Trim() }; int kq = 0; try { kq = cls.ExecuteSP("spBienDong", Paras, Values); if (kq > 0) { //MessageBox.Show("OK!"); } else { MessageBox.Show("Error!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { string TuNgay = ""; if (dateTimePicker1.Checked == true) { TuNgay = dateTimePicker1.Value.ToString(); } if (cls.ExecuteSP("spTestDatetimePicker2SQL", new string[] { "@TuNgay", "@SoNam" }, new string[] { TuNgay, textBox1.Text.Trim() }) <= 0) { MessageBox.Show("Error!"); } else { LoadDatagridview(); } }
private void ExecuteProcedure(int flag) { string[] Paras = new string[] { "@flag", "@MaQuyen", "@MaQuyenCha", "@YNghia" }; string[] Values = new string[] { flag.ToString(), txtMaQuyen.Text.Trim(), cmbMaQuyenCha.Text.Trim(), txtYNghia.Text.Trim() }; int kq = 0; try { kq = cls.ExecuteSP("spTuDienQuyenHan", Paras, Values); if (kq > 0) { //MessageBox.Show("OK!"); } else { MessageBox.Show("Error!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Execute(int flag) { string[] Paras = new string[] { "@flag", "@MaHoSo", "@DienTich", "@Chu", "@TrangThai" }; string[] Values = new string[] { flag.ToString(), txtMaHoSo.Text.Trim(), txtDienTich.Text.Trim(), txtChu.Text.Trim(), txtTrangThai.Text.Trim() }; int kq = 0; try{ kq = cls.ExecuteSP("spHoSo", Paras, Values); if (kq > 0) { //MessageBox.Show("OK!"); } else { MessageBox.Show("Error!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }