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.
Harieswaran DPosted Dec 31, 2014, 3:54 AM
if u see the following example u will get an idea
public class enty
{
public enty()
{ }
string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
public class businesslogic : enty
{
public businesslogic() { }
public bool isnameset()
{
if(! string.IsNullOrWhiteSpace(Name))
return true;
else
return false;
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
businesslogic ac = new businesslogic();
private void button1_Click(object sender, EventArgs e)
{
ac.Name = "sady";
bool flg = ac.isnameset();
if (flg)
MessageBox.Show("Test");
}
}
Jitendra KumarPosted Dec 31, 2014, 3:51 AM
What type of error come.
Kindly Share ur code file.