예제 #1
0
        private void butxoa_Click(object sender, EventArgs e)
        {
            if (txtsothe.Text == "" || txtmadg.Text == "")
            {
                MessageBox.Show("Chưa chọn thông tin");
                return;
            }
            Thedocgia tdg = new Thedocgia();

            tdg.sothe      = txtsothe.Text;
            tdg.ngaylam    = datengaylam.Value;
            tdg.ngayhethan = datengaylam.Value;
            tdg.matt       = txtmatt.Text;
            tdg.madg       = txtmadg.Text;
            if (MessageBox.Show(string.Format("Xóa thẻ độc giả "), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.DeleteProfile(tdg) > 0)
                {
                    MessageBox.Show("Đã xóa");
                    thedocgia_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Thông tin chưa được xóa");
                }
            }
        }
예제 #2
0
        private void butluu_Click(object sender, EventArgs e)
        {
            if (txtsothe.Text == "" || txtmadg.Text == "")
            {
                MessageBox.Show("Chưa nhập đủ thông tin");
                return;
            }
            Thedocgia tdg = new Thedocgia();

            tdg.sothe      = txtsothe.Text;
            tdg.ngaylam    = datengaylam.Value;
            tdg.ngayhethan = datengaylam.Value;
            tdg.matt       = txtmatt.Text;
            tdg.madg       = txtmadg.Text;
            if (MessageBox.Show(string.Format("thêm thẻ độc giả"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.InsertProfile(tdg) > 0)
                {
                    MessageBox.Show("Đã thêm");
                    thedocgia_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Mã thủ thư đã tồn tại");
                }
            }
        }
예제 #3
0
 public static int DeleteProfile(Thedocgia tdg)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@sothe", tdg.sothe),
     };
     return(DataProvider.ExecuteNonQuery("xoathedocgia", para));
 }
예제 #4
0
 public static int UpdateProfile(Thedocgia tdg)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@sothe", tdg.sothe),
         new SqlParameter("@ngaylam", tdg.ngaylam),
     };
     return(DataProvider.ExecuteNonQuery("suathedocgia", para));
 }
예제 #5
0
 public static int InsertProfile(Thedocgia tdg)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@sothe", tdg.sothe),
         new SqlParameter("@ngaylam", tdg.ngaylam),
         new SqlParameter("@ngayhethan", tdg.ngayhethan),
         new SqlParameter("@madg ", tdg.madg),
         new SqlParameter("@matt ", tdg.matt)
     };
     return(DataProvider.ExecuteNonQuery("themthedocgia", para));
 }
예제 #6
0
 public static int DeleteProfile(Thedocgia tdg)
 {
     return(Dao.DeleteProfile(tdg));
 }
예제 #7
0
 public static int UpdateProfile(Thedocgia tdg)
 {
     return(Dao.UpdateProfile(tdg));
 }
예제 #8
0
 public static int InsertProfile(Thedocgia tdg)
 {
     return(Dao.InsertProfile(tdg));
 }