private void BindParentExpensetype()
{
var parent_ids = (db.MstrBudgetLines.Where(y => y.ParenetID != null).Select(x => x.ParenetID).Distinct()).ToList();
var Parents = (from e1 in db.MstrBudgetLines
where e1.IsDeleted==0 && e1.IsActive==1
select new
{
parentid=e1.BudgetLinesPkID,
BudgetLinesPkID = e1.BudgetLinesPkID,
BudgetLinesName = e1.BudgetLinesName
}).ToList().Where(x=>parent_ids.Contains(x.parentid));
ddlparentexpensetype.DataSource = Parents;
ddlparentexpensetype.DataValueField = "BudgetLinesPkID";
ddlparentexpensetype.DataTextField = "BudgetLinesName";
ddlparentexpensetype.DataBind();
}
{
var parent_ids = (db.MstrBudgetLines.Where(y => y.ParenetID != null).Select(x => x.ParenetID).Distinct()).ToList();
var Parents = (from e1 in db.MstrBudgetLines
where e1.IsDeleted==0 && e1.IsActive==1
select new
{
parentid=e1.BudgetLinesPkID,
BudgetLinesPkID = e1.BudgetLinesPkID,
BudgetLinesName = e1.BudgetLinesName
}).ToList().Where(x=>parent_ids.Contains(x.parentid));
ddlparentexpensetype.DataSource = Parents;
ddlparentexpensetype.DataValueField = "BudgetLinesPkID";
ddlparentexpensetype.DataTextField = "BudgetLinesName";
ddlparentexpensetype.DataBind();
}