Z
zleug
Guest
Hi All.
My WPF form has DataGrid. The first column is a CheckBox column. I would like when the button is clicked, all row(s) where the CheckBoxes is checked, insert into a EF table. The DataGrid populated by this method.
Public static IEnumerable<EmployeeDepartmentDT> GetEmployeeList(int deptid)
{
using (var context = new Model1())
{
var emplist =
from employee in context.Employees
where !context.EmployeeDepartment.Any(ed => (ed.EmpId == employee.ID) && (ed.DeptId == deptid))
select new EmployeeDepartmentDT
{
EmpName = employee.EmpName,
IsActive = employee.IsActive,
CreatedDate = employee.CreatedDate,
CreatedBy = employee.CreatedBy
};
return emplist.ToArray();
}
}
How to do it? I will appreciate for sample.
Thanks.
Continue reading...
My WPF form has DataGrid. The first column is a CheckBox column. I would like when the button is clicked, all row(s) where the CheckBoxes is checked, insert into a EF table. The DataGrid populated by this method.
Public static IEnumerable<EmployeeDepartmentDT> GetEmployeeList(int deptid)
{
using (var context = new Model1())
{
var emplist =
from employee in context.Employees
where !context.EmployeeDepartment.Any(ed => (ed.EmpId == employee.ID) && (ed.DeptId == deptid))
select new EmployeeDepartmentDT
{
EmpName = employee.EmpName,
IsActive = employee.IsActive,
CreatedDate = employee.CreatedDate,
CreatedBy = employee.CreatedBy
};
return emplist.ToArray();
}
}
How to do it? I will appreciate for sample.
Thanks.
Continue reading...