Beispiel #1
0
 public int Update(PhieuThuDoanKhachVO phieuthudoankhachVO)
 {
     try
     {
         return(phieuThuDoanKhachDAO.Update(phieuthudoankhachVO));
     }
     catch (SqlException e)
     {
         throw e;
     }
 }
Beispiel #2
0
 public int Insert(PhieuThuDoanKhachVO phieuthudoankhachVO)
 {
     try
     {
         return(phieuThuDoanKhachDAO.Insert(phieuthudoankhachVO));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Beispiel #3
0
        private PhieuThuDoanKhachVO GetPhieuThuDoanKhachVO()
        {
            PhieuThuDoanKhachVO phieuVO = new PhieuThuDoanKhachVO();

            phieuVO.SO_PHIEU      = int.Parse(txt_SoPhieu.Text.Substring(2));
            phieuVO.MA_CA_TRUC    = int.Parse(cbo_Catruc.SelectedValue.ToString().Substring(2));
            phieuVO.MA_DOAN_KHACH = int.Parse(cbo_DoanKhach.SelectedValue.ToString().Substring(2));
            phieuVO.NGAY_PHIEU    = date_NgayPhieu.DateTime;
            if (txt_Sotien.Text == "")
            {
                txt_Sotien.Text = "0";
            }
            phieuVO.SO_TIEN       = Double.Parse(txt_Sotien.Text.ToString());
            phieuVO.NOI_DUNG_THU  = txt_NoiDungThu.Text;
            phieuVO.HINH_THUC_THU = txt_HinhThucThu.Text;
            return(phieuVO);
        }
Beispiel #4
0
        public int Update(PhieuThuDoanKhachVO phieuThuDoanKhachVO)
        {
            try
            {
                String         query         = "UPDATE PHIEU_THU_DOAN_KHACH SET MA_DOAN_KHACH=@MA_DOAN_KHACH,MA_CA_TRUC=@MA_CA_TRUC,NGAY_PHIEU=@NGAY_PHIEU,SO_TIEN=@SO_TIEN,NOI_DUNG_THU=@NOI_DUNG_THU,HINH_THUC_THU=@HINH_THUC_THU WHERE SO_PHIEU=@SO_PHIEU";
                SqlParameter[] sqlParameters = new SqlParameter[7];
                sqlParameters[0] = new SqlParameter("@SO_PHIEU", phieuThuDoanKhachVO.SO_PHIEU);
                sqlParameters[1] = new SqlParameter("@MA_DOAN_KHACH", phieuThuDoanKhachVO.MA_DOAN_KHACH);
                sqlParameters[2] = new SqlParameter("@MA_CA_TRUC", phieuThuDoanKhachVO.MA_CA_TRUC);
                sqlParameters[3] = new SqlParameter("@NGAY_PHIEU", phieuThuDoanKhachVO.NGAY_PHIEU);
                sqlParameters[4] = new SqlParameter("@SO_TIEN", phieuThuDoanKhachVO.SO_TIEN);
                sqlParameters[5] = new SqlParameter("@NOI_DUNG_THU", phieuThuDoanKhachVO.NOI_DUNG_THU);
                sqlParameters[6] = new SqlParameter("@HINH_THUC_THU", phieuThuDoanKhachVO.HINH_THUC_THU);

                return(Program.DBConnection.ExecuteNonQuery(query, sqlParameters));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Beispiel #5
0
        public int Insert(PhieuThuDoanKhachVO phieuThuDoanKhachVO)
        {
            try
            {
                String         query         = "INSERT INTO PHIEU_THU_DOAN_KHACH VALUES(@MA_DOAN_KHACH,@MA_CA_TRUC,@NGAY_PHIEU,@SO_TIEN,@NOI_DUNG_THU,@HINH_THUC_THU)";
                SqlParameter[] sqlParameters = new SqlParameter[6];

                sqlParameters[0] = new SqlParameter("@MA_DOAN_KHACH", phieuThuDoanKhachVO.MA_DOAN_KHACH);
                sqlParameters[1] = new SqlParameter("@MA_CA_TRUC", phieuThuDoanKhachVO.MA_CA_TRUC);
                sqlParameters[2] = new SqlParameter("@NGAY_PHIEU", phieuThuDoanKhachVO.NGAY_PHIEU);
                sqlParameters[3] = new SqlParameter("@SO_TIEN", phieuThuDoanKhachVO.SO_TIEN);
                sqlParameters[4] = new SqlParameter("@NOI_DUNG_THU", phieuThuDoanKhachVO.NOI_DUNG_THU);
                sqlParameters[5] = new SqlParameter("@HINH_THUC_THU", phieuThuDoanKhachVO.HINH_THUC_THU);

                return(Program.DBConnection.ExecuteNonQuery(query, sqlParameters));
            }
            catch (Exception e)
            {
                throw e;
            }
        }