public TblHD_Xuat GetHD_No(int _maKH) { string sql = string.Format("select *, convert(char(10), NGAYLAP,103) as NGAYLAP1" + " from dbo.HD_XUAT where MAKH={0} and TINHTRANG={1} order by NGAYXUAT asc", _maKH, 1); tblHDXuat = new TblHD_Xuat(sql); return(tblHDXuat); }
public TblHD_Xuat GetHD_CongNo(int _maKH) { string sql = string.Format("select *, convert(char(10), NGAYLAP,103) as NGAYLAP1, " + "DATEDIFF (day , NGAYXUAT , GETDATE()+1) as SoNgayNo," + " convert(char(10),(select GETDATE()+(select HanNo from KH where MAKH={0})),103) as HanTra, " + "((select HanNo from KH where MAKH={0}) -DATEDIFF (day , NGAYXUAT , GETDATE()+1) ) as SoNgayCL " + " from dbo.HD_XUAT where MAKH={0} and TINHTRANG={1} order by NGAYXUAT asc", _maKH, 1); tblHDXuat = new TblHD_Xuat(sql); return(tblHDXuat); }
public void HDXuat_No(int maKH) { Refesh(); try { tblHDXuat = tPhieuThu.GetHD_No(maKH); if (tblHDXuat != null) { lvHD.Items.Clear(); for (int i = 0; i < tblHDXuat.Rows.Count; i++) { Add_LVHD(lvHD, tblHDXuat, i); } } } catch (Exception ex) { TLog.WriteErr("frmPHIEUTHU_LoadHD_No", ex.Message + "|" + ex.StackTrace); } }
public void HDXuat_No(int maKH) { try { tblHDXuat = tPhieuThu.GetHD_CongNo(maKH); DataTable dt = tKH.GetKhachHangID(maKH); txtDiaChi.Text = dt.Rows[0]["DIACHI"].ToString(); txtDT.Text = dt.Rows[0]["DIENTHOAI"].ToString(); txtMaKH.Text = dt.Rows[0]["CODEKH"].ToString(); if (tblHDXuat != null) { lvHD.Items.Clear(); for (int i = 0; i < tblHDXuat.Rows.Count; i++) { Add_LVHD(lvHD, tblHDXuat, i); } } } catch (Exception ex) { TLog.WriteErr("frmCongNo_LoadHD_No", ex.Message + "|" + ex.StackTrace); } }