private void LoadObject(int id) { using (var db = new DAL.dbDataContext()) { cusVendor = db.CustomersAndVendors.Single(s => s.ID == id); isCustomer = cusVendor.IsCustomer; GetData(); } }
private void Frm_CustomerVendorList_Load(object sender, EventArgs e) { var ins = new DAL.CustomersAndVendor(); gridView1.Columns[nameof(ins.ID)].Visible = false; gridView1.Columns[nameof(ins.AccountID)].Visible = false; gridView1.Columns[nameof(ins.IsCustomer)].Visible = false; gridView1.Columns[nameof(ins.Name)].Caption = "الاسم"; gridView1.Columns[nameof(ins.Phone)].Caption = "الهاتف"; gridView1.Columns[nameof(ins.Mobile)].Caption = "الموبيل"; gridView1.Columns[nameof(ins.Address)].Caption = "العنوان"; gridView1.OptionsBehavior.Editable = false; gridView1.DoubleClick += GridView1_DoubleClick; if (isCustomer) { Session.Customers.ListChanged += Vendors_ListChanged; } else { Session.Vendors.ListChanged += Vendors_ListChanged; } }
public override void New() { cusVendor = new DAL.CustomersAndVendor(); base.New(); }