Arshi Khan

Arshi Khan

  • NA
  • 15
  • 14.3k

How to use Delete fuction from business logic layer

Dec 31 2014 2:04 AM
Currently I'm working on a Windows Project. I have a data access layer and  business logic layer. I made a function of Delete in it. But I don't know how to use it on form. I give an example to understand you.
 
My Insert Coding on form is following-
MasterClothDesign obj = new MasterClothDesign();             // MasterClothDesign is the class of Business Logic Layer
obj.Cloth_Design_Name = txtDesignName.Text;
obj.Save();
 
In Business Logic Layer I made the following function of delete.
 
public void DeleteBy(IDbTransaction txn)
{
new MasterClothDesignData(txn).MasterClothDesignData_DeleteByClothDesignId(Cloth_Design_Id);
}
 
Delete Coding on form is following
private void btnDelete_Click(object sender, EventArgs e)
{
MasterClothDesign obj = new MasterClothDesign();
obj.Cloth_Design_Id = Convert.ToInt32(lblDesignId.Text);
obj.DeleteBy();
 }
It gives the error on DeleteBy.  So how this function should be write on form? Thanks in advance.
 

Answers (2)