Base Edit Form View and Description
Base Edit Form View and Description
BaseEditForm Designer : BaseEditForm : In the project, we have created 2 BaseForm to avoid duplication of code and not to make continuous design arrangements.Thanks to these,the forms in all modules we will add will be implemented.
Thus all EditForms will work in the same design and logic. In this form, we will override the variables and functions that will be defined in the forms that were implemented and fill them. As a result, instead of writing code one by one in each form, we’ll write once and use it in the whole project.

New Button: Opens form in new recording mode
Save Button: Used to save changes to the form
Delete Button: Runs in record deletion mode selected
Close Button: Used to close open form without making changes
BaseEditForm View Code :
public partial class BaseEditForm : RibbonForm
{
protected IBaseEntity CurrentEntity;//The last version of data after change
protected virtual void ControllerLoads() { }//It is a function that loads data to objects
protected virtual void CurrentControllerCreate() { }//It records where it will send and what it will send when recording data.
protected internal bool DataReload = false;//For updating after registration is added.
protected PositiveLayoutControl DataLayaoutControl;
protected PositiveLayoutControl[] DataLayaoutControls;
protected SaleContext tContext = new SaleContext();
public BaseEditForm()
{
InitializeComponent();
}
protected void EventsLoad()// we create the events that will be used in the list forms.
{
foreach (BarItem button in rbcEditHeader.Items)
button.ItemClick += Button_ItemClick;
//Form Events
Load += BaseEditForm_Load;
}
private void BaseEditForm_Load(object sender, EventArgs e) { }
private void FrmClose()//This is the function we use to close the form.
{
Close();
}
protected virtual void DatabaseAddOrUpdate() { } // Our function file that we will use when updating the database or making new recordings.
protected virtual void NewData() { }
protected internal void DataLoad() //The function file we call Ovveride will run the following codes in all places where we call this function.
{
EventsLoad();
}
private void Button_ItemClick(object sender, ItemClickEventArgs e)
{
// btnNew With the new registration process.
if (e.Item == btnNew)
NewData();
//btnSave Automatically record transactions.
else if (e.Item == btnSave)
DatabaseAddOrUpdate();
//btnClose Through the form, we will make the exit process.
else if (e.Item == btnClose)
FrmClose();
}
}