private void BindData() { if (Request.QueryString["BillID"] != null) { En_Bill BEBill = new En_Bill(); BUBill bill = new BUBill(); BEBill = bill.SelectOneBill(Convert.ToInt32(Request.QueryString["BillID"])); if (BEBill != null) { lblBuyDate.Text = BEBill._BuyDate.ToString(); lblEmployee.Text = BEBill._Employee.ToString(); //lblProvName.Text = BEBill._ProvName.ToString(); lblTotal.Text = objfun.ChangeTypeMoney(BEBill._Total.ToString()); lblToPay.Text = objfun.ChangeTypeMoney(BEBill._Topay.ToString()); //lblRemain.Text = BEBill._Remain.ToString(); } } }
public En_Bill SelectOneBill(int BillID) { try { da = new DataAccess(); cmd = new SqlCommand("SP_SelectOne_Bill", da.SqlConn()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("BillID", BillID); cmd.Connection.Open(); cmd.ExecuteNonQuery(); sda = new SqlDataAdapter(cmd); ds = new DataSet(); sda.Fill(ds, "Bill"); DataTable dTable = new DataTable(); dTable = ds.Tables["Bill"]; En_Bill BEBill = new En_Bill(dTable.Rows[0]); return BEBill; } catch (Exception ex) { ex.ToString(); return null; } }