/* * CapNhatChiTietXuat trả về * 1:thành công * 0:thất bại */ public static int CapNhatChiTietXuat(DTO_ChiTietXuat ctx) { string query = "update ChiTietXuatHang set IdMatHang =" + ctx.IdMatHang + ",SoLuong=" + ctx.SoLuong + ",DonGia=" + ctx.DonGia + " ,DonViTinh=" + ctx.DonViTinh + ",ThanhTien=" + ctx.ThanhTien + " where IdPhieuXuat=" + ctx.IdPhieuXuat; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
public static int CapNhatQuyDinhTienNo(DTO_QuyDinhTienNo qd) { string query = "update QuyDinhTienNo set TienNoToiDa=" + qd.TienNoToiDa + " where IdLoaiDL=" + qd.IdLoaiDL; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * CapNhatMatHang trả về * 1:thành công * 0:thất bại */ public static int CapNhatMatHang(DTO_MatHang matHang) { string query = "update MatHang set TenMatHang=N'" + matHang.TenMatHang + "' where IdMatHang=" + matHang.IdMatHang; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * CapNhatLoaiDaiLy trả về * 1:thành công * 0:thất bại */ public static int CapNhatLoaiDaiLy(DTO_LoaiDL loaiDL) { string query = "update LoaiDaiLy set TenLoaiDL =N'" + loaiDL.TenLoaiDL + "' where IdLoaiDL=" + loaiDL.IdLoaiDL; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * XoaChiTietXuat trả về * 1:thành công * 0:thất bại */ public static int XoaChiTietXuat(int idPhieuXuat) { string query = "delete ChiTietXuatHang where IdPhieuXuat=" + idPhieuXuat; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * XoaLoaiDaiLy trả về * 1:thành công * 0:thất bại */ public static int XoaLoaiDaiLy(int id) { string query = "delete LoaiDaiLy where IdLoaiDL=" + id; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
public static int XoaByIdDL(int idDl) { string query = "delete PhieuThuTien where IdDaiLy=" + idDl; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * trả về 0:update thất bại * trả về 1:update thành công */ public static int CapNhatQuyDinhMatHang(DTO_QuyDinhMatHang qd) { string query = "update QuyDinhMatHang set DonViTinh=N'" + qd.DonViTinh + "',DonGia=" + qd.DonGia + " where IdMatHang=" + qd.IdMatHang; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * CapNhatLoaiDaiLy trả về * 1:thành công * 0:thất bại */ public static int CapNhatQuan(DTO_Quan quan) { string query = "update Quan set TenQuan =N'" + quan.TenQuan + "' where IdQuan=" + quan.IdQuan; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * XoaLoaiDaiLy trả về * 1:thành công * 0:thất bại */ public static int XoaQuan(int id) { string query = "delete Quan where IdQuan=" + id; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * XoaMatHang trả về * 1:thành công * 0:thất bại */ public static int XoaMatHang(int id) { DAL_ChiTietXuat.XoaChiTietXuat(id); string query = "delete MatHang where IdMatHang=" + id; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * trả về 0: update không thành không * trả về #0 : thành công */ public static int SuaQuyChe(DTO_QuyCheToChuc qc) { string query = "update QuyCheToChuc set SoLoaiDaiLy=" + qc.SoLoaiDaiLy + ",SoDaiLyToiDa=" + qc.SoDaiLyToiDa + ",SoMatHang=" + qc.SoMatHang + ",SoQuan=" + qc.SoMatHang; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
//public void Xoapxbyid(int id) //{ // string query = "delete PhieuXuatHang where IdPhieuXuat=" + id; //} /* * CapNhatPhieuXuat trả về * 1:thành công * 0:thất bại */ public static int CapNhatPhieuXuat(DTO_PhieuXuatHang pxh) { string ngayXuatSql = pxh.NgayXuat.ToString("yyyy-MM-dd"); string query = "update PhieuXuatHang set NgayXuat ='" + ngayXuatSql + "',IdDaiLy=" + pxh.IdDaiLy + " ,CMND='" + pxh.Cmnd + "' where IdPhieuXuat=" + pxh.IdPhieuXuat; int result = ResultQuery.GetResultQuery(conn, query); return(result); }
/* * ThemPhieuThu trả về * 1:thành công * 0:thất bại */ public static int ThemPhieuThu(DTO_PhieuThuTien ptt) { int kq = 0; string ngayThuSql = ptt.NgayThu.ToString("yyyy-MM-dd"); string query = "insert into PhieuThuTien(NgayThu, SoTienThu, IdDaiLy, CMND) values('" + ngayThuSql + "'," + ptt.SoTienThu + "," + ptt.IdDaiLy + ",'" + ptt.Cmnd + "')"; kq = ResultQuery.GetResultQuery(conn, query); return(kq); }
/* * ThemChiTietXuat trả về * 1:thành công * 0:thất bại */ public static int ThemChiTietXuat(DTO_ChiTietXuat ctx) { int kq = 0; string query = "insert into ChiTietXuatHang(IdPhieuXuat, IdMatHang, SoLuong, DonGia, DonViTinh, ThanhTien) values(" + ctx.IdPhieuXuat + "," + ctx.IdMatHang + "," + ctx.SoLuong + "," + ctx.DonGia + ", N'" + ctx.DonViTinh + "', " + ctx.ThanhTien + ")"; kq = ResultQuery.GetResultQuery(conn, query); return(kq); }
/* * ThemPhieuXuat trả về * 1:thành công * 0:thất bại */ public static int ThemPhieuXuat(DTO_PhieuXuatHang pxh) { int kq = 0; string ngayXuatSql = pxh.NgayXuat.ToString("yyyy-MM-dd"); string query = "insert into PhieuXuatHang(NgayXuat,IdDaiLy,CMND) values ('" + ngayXuatSql + "'," + pxh.IdDaiLy + ",'" + pxh.Cmnd + "')"; kq = ResultQuery.GetResultQuery(conn, query); return(kq); }
/* * XoaDaiLy trả về * 0 : sửa thất bại * 1 : sửa thành công */ public static int XoaDaiLy(int idDaiLy) { //DAL_ChiTietXuat.XoaChiTietXuat(idDaiLy); //DAL_PhieuXuat.XoaByIdDl(idDaiLy); //DAL_PhieuThuTien.XoaByIdDl(idDaiLy); //DAL_CongNo.XoaCongNo(idDaiLy); //DAL_DoanhSo.XoaDoanhSo(idDaiLy); string query = "delete from DaiLy where IdDaiLy=" + idDaiLy; int result = ResultQuery.GetResultQuery(conn, query); return(result); }