コード例 #1
0
        private void RefreshForm()
        {
            RgvProducts.DataSource = ProductViewModel.GetAllNonDeletedEntities();

            RcboxSuppliers.DataSource  = SupplierViewModel.GetAllEntities();
            RcboxCategories.DataSource = CategoryViewModel.GetAllEntities();
        }
コード例 #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            RgvSuppliers.DataSource = SupplierViewModel.GetAllEntities();

            // Product GridView
            RgvProducts.DataSource = ProductViewModel.GetAllEntities(GetSelectedSupplier(RgvSuppliers.CurrentRow));
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 private void UpdateSupplierGridView()
 {
     RgvSuppliers.DataSource = SupplierViewModel.GetAllEntities();
 }