private void RefreshForm() { RgvProducts.DataSource = ProductViewModel.GetAllNonDeletedEntities(); RcboxSuppliers.DataSource = SupplierViewModel.GetAllEntities(); RcboxCategories.DataSource = CategoryViewModel.GetAllEntities(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); RgvSuppliers.DataSource = SupplierViewModel.GetAllEntities(); // Product GridView RgvProducts.DataSource = ProductViewModel.GetAllEntities(GetSelectedSupplier(RgvSuppliers.CurrentRow)); }
private void btnSave_Click(object sender, EventArgs e) { ValidatePanel(); if (lblContactNameWarning.Visible || lblPhoneNumberWarning.Visible || lblAddressWarning.Visible) { return; } Supplier newSupplier = GetNewSupplierInfo(); if (SupplierViewModel.GetAllEntities().Contains(newSupplier)) { MessageBox.Show("این تامین کننده قبلا در سیستم ثبت شده است"); } else { SupplierViewModel.InsertEntity(newSupplier); MessageBox.Show("تامین کننده با موفقیت ثبت شد"); UpdateSupplierGridView(); } }
private void UpdateSupplierGridView() { RgvSuppliers.DataSource = SupplierViewModel.GetAllEntities(); }