Ejemplo n.º 1
0
        public static int DeleteProfile(ChiTietPhieuXuatObj qh)
        {
            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@ma", qh.MaPX),
                new SqlParameter("@masp", qh.MaSP)
            };

            return(ConectToSQL_Datvd.Execute_NonQuery("XoaPhieuXuatCT", para));
        }
Ejemplo n.º 2
0
        public static int UpdateProfile(ChiTietPhieuXuatObj qh)
        {
            SqlParameter[] para = new SqlParameter[]
            { new SqlParameter("@ma", qh.MaPX),
              new SqlParameter("@masp", qh.MaSP),
              new SqlParameter("@sl", qh.SoLuong),
              new SqlParameter("@ChungLoai", qh.ChungLoai) };

            return(ConectToSQL_Datvd.Execute_NonQuery("SuaPhieuXuatCT", para));
        }
Ejemplo n.º 3
0
        private void btnLuu1_Click(object sender, EventArgs e)
        {
            if (cboTenSP.Text == "" || comboBox1.Text == "" || txtSL.Text == "")
            {
                MessageBox.Show("Bạn Cần Điền Đầy Đủ Thông Tin Trước Khi Lưu", "Thông Báo");
            }
            else
            if (check1 == 1)
            {
                ChiTietPhieuXuatObj qh = new ChiTietPhieuXuatObj();
                qh.MaPX      = txtMaPhieu.Text;
                qh.MaSP      = cboTenSP.SelectedValue.ToString();
                qh.SoLuong   = int.Parse(txtSL.Text);
                qh.ChungLoai = comboBox1.Text;


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

            else
            {
                ChiTietPhieuXuatObj qh = new ChiTietPhieuXuatObj();
                qh.MaPX      = txtMaPhieu.Text;
                qh.MaSP      = cboTenSP.SelectedValue.ToString();
                qh.SoLuong   = int.Parse(txtSL.Text);
                qh.ChungLoai = comboBox1.Text;
                if (PhieuXuatChiTietCtrl.UpdateProfile(qh) > 0)
                {
                    MessageBox.Show("Sửa thành công");
                    frmPhieuXuat_Load(sender, e);
                    LoadDataChiTiet();
                    dgvPhieuXuat.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Không thể Sửa");
                }
            }
        }
Ejemplo n.º 4
0
 private void btnXoa1_Click(object sender, EventArgs e)
 {
     if (cboTenSP.Text == "")
     {
         MessageBox.Show("Bạn cần chọn Sản Phẩm để xóa !", "Thông Báo");
     }
     else
     if (MessageBox.Show("Bạn có chắc chắn muốn xóa Sản Phẩm " + cboTenSP.Text + "?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         ChiTietPhieuXuatObj qh = new ChiTietPhieuXuatObj();
         qh.MaPX = txtMaPhieu.Text;
         qh.MaSP = cboTenSP.SelectedValue.ToString();
         if (PhieuXuatChiTietCtrl.DeleteProfile(qh) > 0)
         {
             MessageBox.Show("Xóa thành công");
             LoadDataChiTiet();
         }
         else
         {
             MessageBox.Show("Không thể Xóa");
         }
     }
 }
Ejemplo n.º 5
0
 public static int DeleteProfile(ChiTietPhieuXuatObj qh)
 {
     return(PhieuXuatChiTietMod.DeleteProfile(qh));
 }
Ejemplo n.º 6
0
 public static int InsertProfile(ChiTietPhieuXuatObj qh)
 {
     return(PhieuXuatChiTietMod.InsertProfile(qh));
 }