Base List Form View and Description


Base List Form View and Description

BaseListForm Designer : BaseListForm : The listing forms of all modules to be included in the project will be added as an implementation from the above form.On the listing page , we first drag and drop a Gridview or Badedview into our form and right after that,we set the Dock property of one longNavigator to Bottom.. If you have added Gridview or Bandedview , whichever you added, we’ll make ‘Fill’ the Dock property of that component. Then click the Run Designer button on the added Gridview or Bandedview component and enter the Columns section. The id and defaultCode field that came from the database comes automatically. You just add the field you want to add to your module, then you can switch to the encoding section.

New Button: Opens EditForm in new recording mode

New Button 2: Opens EditForm in new recording mode (PLUG)

Delete Button: Runs in record deletion mode selected

Select Button: Used to make selections in subforms

Edit Button: Used for edit mode.

Activity Button: We will use it to see the movements of the related form.

Refresh Button: Used to refresh data in GridView

Filter Button: Form shows the recorded related filters or new added

Close Button: Used to close open form without making changes

BaseEditForm View Code :

     public partial class BaseListForm : DevExpress.XtraBars.Ribbon.RibbonForm
{
  protected internal GridView Table; //We’re getting an instance from GridView.
  protected ControlNavigator Navigators; //We’re getting an instance for Navigator
  private bool _formTemplateSave;//we'll use it to save the new dimensions of the form.
  private bool _tableTemplateSave;//to save the current status of the tables.
  protected internal IBaseEntity SelectedEntity;
  protected internal bool Chosen = false;//Entity selected status.
  protected internal long? SelectedId;
  protected internal SaleContext tContext = new SaleContext(); //We will use the contexts we will use in the Base Forms instead of constantly refreshing them.
  public BaseListForm()
  {
      InitializeComponent();
  }
  private void EventsLoad()// we create the events that will be used in the list forms.
  {
      foreach (BarItem button in rbcListHeader.Items)
          button.ItemClick += Button_ItemClick;
      //Form Events
      Shown += BaseListForm_Shown;
      Load += BaseListForm_Load;
      LocationChanged += BaseListForm_LocationChanged;
      SizeChanged += BaseListForm_SizeChanged;
      FormClosing += BaseListForm_FormClosing;
  }
  private void BaseListForm_FormClosing(object sender, FormClosingEventArgs e)
  {
      TemplateSave();
  }
  private void BaseListForm_SizeChanged(object sender, EventArgs e)
  {
      if (IsMdiChild)
          _formTemplateSave = true;
  }
  private void BaseListForm_LocationChanged(object sender, EventArgs e)
  {
      if (!IsMdiChild)
          _formTemplateSave = true;
  }
  private void BaseListForm_Load(object sender, EventArgs e)
  {
      TemplateLoad();
  }
  private void BaseListForm_Shown(object sender, EventArgs e) { }
  private void TemplateSave()
  {
      if (_formTemplateSave)
          Name.FormTemplateSave(Left, Top, Width, Height, WindowState);
  }
  private void TemplateLoad() { }
  protected internal void DataLoad()
  {
      EventsLoad();
      ListData();
      VariablesFill();
      Navigators.NavigatableControl = Table.GridControl;
  }
  private void FrmClose()//This is the function we use to close the form.
  {
      Close();
  }
  protected virtual void ListData() { }
  protected virtual void OpenEditFormAdd() { }
  protected virtual void OpenNewsInvoiceForms(string caption) { }
  protected virtual void OpenEditForm() { }
  protected virtual void ActivityOpen() { }
  protected virtual void DataSelections() { }
  protected virtual void VariablesFill() { }// This is the function that we upload data to the components
  protected virtual void EntityDelete() { }
  private void Button_ItemClick(object sender, ItemClickEventArgs e)
  {
      if (e.Item == btnNew)
          OpenEditFormAdd();
      else if (e.Item == btnEdit)
          OpenEditForm();
      else if (e.Item == btnDelete)
          EntityDelete();
      else if (e.Item == btnClose)
          FrmClose();
      else if (e.Item == btnActivityOpen)
          ActivityOpen();
      else if (e.Item == btnRefresh)
          ListData();
      else if (e.Item == btnSelect)
          DataSelections();
      else if (e.Item == btnSaleInvoice)
          OpenNewsInvoiceForms(e.Item.Caption);
      else if (e.Item == btnPurchaseInvoice)
          OpenNewsInvoiceForms(e.Item.Caption);


  } 
}
}
HTML