public void loadBRANCHOFFICERECEIPT(String id, TextBox txtbranchID, ComboBox cbbHeadQuater, ComboBox cbbBranch) { CMART0Entities DataAccess = new CMART0Entities(); BranchOfficeReceipt Branch = new BranchOfficeReceipt(); Branch = DataAccess.BranchOfficeReceipts.Single(st => st.BranchOfficeID == id); txtbranchID.Text = Branch.BranchOfficeID.ToString(); cbbHeadQuater.SelectedValue = Branch.HeadquaterID; cbbBranch.Text = Branch.Branch; }
public void loadInfoBRANCHOFFICERECEIPTDETAIL(String ID, Label lblIDHeadID, Label lblBranchID, Label lblDate, Label lblBranch, Label lblCreator) { CMART0Entities DataAccess = new CMART0Entities(); Account account = new Account(); BranchOfficeReceipt Branch = new BranchOfficeReceipt(); Branch = DataAccess.BranchOfficeReceipts.Single(st => st.BranchOfficeID == ID); account = DataAccess.Accounts.Single(st => st.AccountID == Branch.AccountID); lblBranchID.Text = ID; lblBranch.Text = Branch.Branch; lblDate.Text = Branch.Date.ToShortDateString(); lblIDHeadID.Text = Branch.HeadquaterID; lblCreator.Text = account.FullName; }
private void lstReceipt_Click(object sender, EventArgs e) { CMART0Entities DataAccess = new CMART0Entities(); BranchOfficeReceipt BranchO = new BranchOfficeReceipt(); BranchOfficeReceiptDetail BranchODetail = new BranchOfficeReceiptDetail(); if (lstReceipt.SelectedRows.Count == 1) { var row = lstReceipt.SelectedRows[0]; var cell = row.Cells["BranchOfficeID"]; String ID = (String)cell.Value; id = ID; BranchO = DataAccess.BranchOfficeReceipts.Single(st => st.BranchOfficeID == ID); txtBranchOID.Text = BranchO.BranchOfficeID.ToString(); DTPDate.Text = BranchO.Date.ToShortDateString(); cbbHeadquater.SelectedItem = BranchO.HeadquaterID.ToString(); cbbBranch.SelectedIndex = int.Parse(BranchO.Branch.ToString()) - 1; BranchODetail = DataAccess.BranchOfficeReceiptDetails.Single(st => st.BranchOfficeID == ID); txtQuantity.Text = BranchODetail.Quantity.ToString(); cbbStatus.SelectedItem = BranchODetail.Status.ToString(); } }