コード例 #1
0
        public static int DeleteProfile(HopDongObj qh)
        {
            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@ma", qh.MaHD)
            };

            return(ConectToSQL_Datvd.Execute_NonQuery("XoaHopDong", para));
        }
コード例 #2
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            if (txtMaHD.Text == "" || txtTenHD.Text == "" || txtLoaiHD.Text == "" || cmbBacLuong.Text == "")
            {
                MessageBox.Show("Bạn Cần Điền Đầy Đủ Thông Tin Trước Khi Lưu", "Thông Báo");
            }
            else
            if (check == 1)
            {
                HopDongObj qh = new HopDongObj();
                qh.MaHD        = txtMaHD.Text;
                qh.TenHD       = txtTenHD.Text;
                qh.LoaiHD      = txtLoaiHD.Text;
                qh.NgayBatDau  = DateTime.Parse(dtpNgayBD.Text);
                qh.NgayKetThuc = DateTime.Parse(dtpNgayKT.Text);

                qh.BacLuong = cmbBacLuong.SelectedValue.ToString();


                if (HopDongCtrl.InsertProfile(qh) > 0)
                {
                    MessageBox.Show("Thêm mới thành công");
                    UCHopDong_Load(sender, e);
                    dgvSach.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Không thể thêm mới");
                }
            }

            else
            {
                HopDongObj qh = new HopDongObj();
                qh.MaHD        = txtMaHD.Text;
                qh.TenHD       = txtTenHD.Text;
                qh.LoaiHD      = txtLoaiHD.Text;
                qh.NgayBatDau  = DateTime.Parse(dtpNgayBD.Text);
                qh.NgayKetThuc = DateTime.Parse(dtpNgayKT.Text);

                qh.BacLuong = cmbBacLuong.SelectedValue.ToString();

                if (HopDongCtrl.UpdateProfile(qh) > 0)
                {
                    MessageBox.Show("Sửa thành công");
                    UCHopDong_Load(sender, e);
                    dgvSach.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Không thể Sửa");
                }
            }
        }
コード例 #3
0
        public static int UpdateProfile(HopDongObj qh)
        {
            SqlParameter[] para = new SqlParameter[]
            { new SqlParameter("@ma", qh.MaHD),
              new SqlParameter("@ten", qh.TenHD),
              new SqlParameter("@loai", qh.LoaiHD),
              new SqlParameter("@ngaybatdau", qh.NgayBatDau),
              new SqlParameter("@ngayketthuc", qh.NgayKetThuc),
              new SqlParameter("@bac", qh.BacLuong) };

            return(ConectToSQL_Datvd.Execute_NonQuery("SuaHopDong", para));
        }
コード例 #4
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (txtMaHD.Text == "")
     {
         MessageBox.Show("Bạn cần chọn Hợp Đồng để xóa !", "Thông Báo");
     }
     else
     if (MessageBox.Show("Bạn có chắc chắn muốn xóa Hợp Đồng " + txtTenHD.Text + "?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         HopDongObj qh = new HopDongObj();
         qh.MaHD = txtMaHD.Text;
         if (HopDongCtrl.DeleteProfile(qh) > 0)
         {
             MessageBox.Show("Xóa thành công");
             UCHopDong_Load(sender, e);
         }
         else
         {
             MessageBox.Show("Không thể Xóa");
         }
     }
 }
コード例 #5
0
 public static int DeleteProfile(HopDongObj qh)
 {
     return(HopDongMod.DeleteProfile(qh));
 }
コード例 #6
0
 public static int UpdateProfile(HopDongObj qh)
 {
     return(HopDongMod.UpdateProfile(qh));
 }
コード例 #7
0
 public static int InsertProfile(HopDongObj qh)
 {
     return(HopDongMod.InsertProfile(qh));
 }