Beispiel #1
0
        private void AddEdit(FrmAddEditSupplier addSupplier)
        {
            DialogResult callback = addSupplier.ShowDialog(this);

            if (DialogResult.OK == callback)
            {
                RefreshList();
            }
        }
Beispiel #2
0
        private void FillOLV()
        {
            try
            {
                ovlSupplier.Clear();
                List <ListViewColumnsInfo> list = new List <ListViewColumnsInfo>();
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 100, Header = helper.GetMemberName((SupplierModel c) => c.Supplier_Id), Visible = true
                });
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 300, Header = helper.GetMemberName((SupplierModel c) => c.Comp_Name), Visible = true
                });
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 100, Header = helper.GetMemberName((SupplierModel c) => c.Supplier_Mobileno), Visible = true
                });
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 100, Header = helper.GetMemberName((SupplierModel c) => c.Address), Visible = true
                });
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 100, Header = helper.GetMemberName((SupplierModel c) => c.VatNo), Visible = true
                });
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 55, Header = helper.GetMemberName((SupplierModel c) => c.IsActive), Visible = true
                });
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 50, Header = helper.GetMemberName((SupplierModel c) => c.Update), Visible = true, IsButton = true
                });
                list.Add(new ListViewColumnsInfo()
                {
                    ColumnSize = 50, Header = helper.GetMemberName((SupplierModel c) => c.Delete), Visible = true, IsButton = true
                });
                helper.GenerateListView(ovlSupplier, list);
                this.ovlSupplier.ButtonClick += delegate(object sender, CellClickEventArgs e)
                {
                    switch (e.ColumnIndex)
                    {
                    case 6:
                        FrmAddEditSupplier addSupplier = new FrmAddEditSupplier(e.Model as SupplierModel);
                        AddEdit(addSupplier);
                        break;

                    case 7:
                        var          model  = e.Model as SupplierModel;
                        DialogResult result = MessageBox.Show(String.Format("Are you sure? you want to delete measurement => {0}", model.Comp_Name), "Delete!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                        if (result.Equals(DialogResult.Yes))
                        {
                            reciever.Delete(model);
                            RefreshList();
                        }
                        break;
                    }
                };
            }
            catch (Exception err) { err.GetBaseException(); }
        }
Beispiel #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FrmAddEditSupplier addSupplier = new FrmAddEditSupplier();

            AddEdit(addSupplier);
        }