if (collection["Department"] == "" || collection["Department"] == null || collection["Department"] == "0")
{
var Department = (from x in db.Departments
where x.Id == 1
orderby x.description ascending
select x.Id).First();
Result.DepartmentId = Department;
}
else
{
var Department = (from x in db.Departments
where x.description == collection["Department"]
orderby x.description ascending
select x.Id).First();
Result.DepartmentId = Department;
}

Jenith ThakkarPosted Jul 20, 2018, 2:42 AM
Bongani GumedePosted Jul 20, 2018, 2:36 AM
Jenith ThakkarPosted Jul 20, 2018, 2:02 AM