Example #1
0
        private void butsua_Click(object sender, EventArgs e)
        {
            if (txtthu.Text == "" || txttuan.Text == "")
            {
                MessageBox.Show("Chưa nhập đủ thông tin");
                return;
            }

            daythay dt = new daythay();

            dt.thu               = txtthu.Text;
            dt.tuan              = txttuan.Text;
            dt.buoi              = txtbuoi.Text;
            dt.tiet              = txttiet.Text;
            dt.lop               = cbxlop.Text;
            dt.magiaoviennghi    = cbxgvn.Text;
            dt.magiaoviendaythay = cbxgvd.Text;
            if (MessageBox.Show(string.Format("sửa thồng tin dạy thay của giáo viên này không?"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.UpdateProfile(dt) > 0)
                {
                    MessageBox.Show("Đã sửa");
                    lichdaythay_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Thông tin chưa được sửa");
                }
            }
        }
Example #2
0
        private void butluu_Click(object sender, EventArgs e)
        {
            if (txtthu.Text == "" || txttuan.Text == "")
            {
                MessageBox.Show("Chưa nhập đủ thông tin!");
                return;
            }
            daythay dt = new daythay();

            dt.thu               = txtthu.Text;
            dt.tuan              = txttuan.Text;
            dt.buoi              = txtbuoi.Text;
            dt.tiet              = txttiet.Text;
            dt.lop               = cbxlop.Text;
            dt.magiaoviennghi    = cbxgvn.Text;
            dt.magiaoviendaythay = cbxgvd.Text;

            if (MessageBox.Show(string.Format("Bạn có muốn lưu lịch dạy thay mmới không?"),
                                "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.InsertProfile(dt) > 0)
                {
                    MessageBox.Show("lưu thành công!");
                    lichdaythay_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("bị Lỗi");
                }
            }
        }
Example #3
0
 internal static int DeleteProfile(daythay dt)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@gvn", dt.magiaoviennghi),
     };
     return(DataProvider.ExecuteNonQuery("xoalichdaythay", para));
 }
Example #4
0
 public static int UpdateProfile(daythay dt)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@tiet", dt.tiet),
         new SqlParameter("@lop", dt.lop),
         new SqlParameter("@gvn", dt.magiaoviennghi),
         new SqlParameter("@gvd", dt.magiaoviendaythay)
     };
     return(DataProvider.ExecuteNonQuery("sualichdaythay", para));
 }
Example #5
0
 public static int InsertProfile(daythay dt)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@thu", dt.thu),
         new SqlParameter("@tuan", dt.tuan),
         new SqlParameter("@buoi", dt.buoi),
         new SqlParameter("@tiet", dt.tiet),
         new SqlParameter("@lop", dt.lop),
         new SqlParameter("@gvn", dt.magiaoviennghi),
         new SqlParameter("@gvd", dt.magiaoviendaythay)
     };
     return(DataProvider.ExecuteNonQuery("themlichdaythay ", para));
 }
Example #6
0
 public static int DeleteProfile(daythay dt)
 {
     return(Dao.DeleteProfile(dt));
 }
Example #7
0
 public static int UpdateProfile(daythay dt)
 {
     return(Dao.UpdateProfile(dt));
 }
Example #8
0
 public static int InsertProfile(daythay dt)
 {
     return(Dao.InsertProfile(dt));
 }