public DTO.Bill getBill(int bid) { DataSet ds = DAL.DALConnect.Instance.ExecuteQueryDataSet("select bid, c.name as customer, price, s.name as staff, purchasedate, tid " + "from bills b join customers c on b.cid = c.cid " + "join employees s on b.cashier = s.eid where bid =" + bid, CommandType.Text); DataRow row = ds.Tables[0].Rows[0]; DTO.Bill bill = new DTO.Bill(row); return(bill); }
private void LoadBill(int bid) { DTO.Bill bill = BLL.BLLBill.Instance.getBill(bid); lblCashier.Text = bill.Cashier; lblCustomer.Text = bill.CustomerName; lblDate.Text = bill.Purchasedate + ""; lblTotalPrice.Text = bill.Price + ""; lblID.Text = bill.Id + ""; lblTable.Text = bill.Table + ""; }
public int GetUncheckedBillIdByTableId(int idTableD) { DataTable data = DataProvider.Instance.ExecuteQuery("SELECT * FROM Bill WHERE idTableD = " + idTableD + " AND statusBill = 0"); if (data.Rows.Count > 0) { Bill bill = new DTO.Bill(data.Rows[0]); return(bill.IdBill); } return(-1); }
public static Bill MapToDomain(DTO.Bill bill) { var dto = new Bill() { AppUserId = bill.AppUserId, Deadline = bill.Deadline, Total = bill.Total, }; return(dto); }
/// <summary> /// Thành công : bill ID /// thất bại -1 /// </summary> /// <param name="id"></param> /// <returns></returns> public int GetuncheckBillByTable(int id) { DataTable data = DAO.DataProvider.Instance.ExecuteQuery("SELECT * FROM dbo.BILL WHERE idTable = " + id + " AND status = 0"); if (data.Rows.Count > 0) { DTO.Bill bill = new DTO.Bill(data.Rows[0]); return(bill.ID); } return(-1); }
public static DTO.Bill Map(Bill bill) { var dto = new DTO.Bill() { Id = bill.Id, AppUserId = bill.AppUserId, Deadline = bill.Deadline, Total = bill.Total, }; return(dto); }