Merge branch 'dev_chapal' into devqc

This commit is contained in:
chapal 2025-09-01 12:52:08 +06:00
commit b125e31d88

View File

@ -1861,12 +1861,12 @@ namespace HRM.UI.Controllers
foreach (var row in ds.Tables[0].AsEnumerable())
{
EmployeeDetailInfo temp = new EmployeeDetailInfo ();
Employee emp = new EmployeeService().GetFromAll(row["EMPLOYEENO"].ToString(), (int)currentUser.PayrollTypeID);
Department tempDepartment = null;
if (emp!= null)
{
tempDepartment = emp.DepartmentID != null ? oDepartment.Find(item => item.ID == emp.DepartmentID) : null;
}
//Employee emp = new EmployeeService().GetFromAll(row["EMPLOYEENO"].ToString(), (int)currentUser.PayrollTypeID);
//Department tempDepartment = null;
//if (emp!= null)
//{
// tempDepartment = emp.DepartmentID != null ? oDepartment.Find(item => item.ID == emp.DepartmentID) : null;
//}
temp.EmployeeNo = row["EmployeeNo"] == null ? "" : row.Field<string>("EmployeeNo");
temp.Name = row["Name"] == null ? "" : row.Field<string>("Name");
@ -1905,71 +1905,76 @@ namespace HRM.UI.Controllers
Department tire2 = null;
Department tire1 = null;
if (tempDepartment != null)
{
if (tempDepartment.ParentID != null)
{
for (int i = (int)tempDepartment.Tier; i > 0; i--)
{
if (i == 5)
{
tire5 = oDepartment.Find(x => x.ID == tempDepartment.ID);
}
if (i == 4)
{
if (tire5 != null)
{
tire4 = oDepartment.Find(x => x.ID == tire5.ParentID);
}
else
{
tire4 = oDepartment.Find(x => x.ID == tempDepartment.ID);
}
}
if (i == 3)
{
if (tire4 != null)
{
tire3 = oDepartment.Find(x => x.ID == tire4.ParentID);
}
else
{
tire3 = oDepartment.Find(x => x.ID == tempDepartment.ID);
}
}
if (i == 2)
{
if (tire3 != null)
{
tire2 = oDepartment.Find(x => x.ID == tire3.ParentID);
}
else
{
tire2 = oDepartment.Find(x => x.ID == tempDepartment.ID);
}
}
if (i == 1)
{
if (tire2 != null)
{
tire1 = oDepartment.Find(x => x.ID == tire2.ParentID);
}
else
{
tire1 = oDepartment.Find(x => x.ID == tempDepartment.ID);
}
}
}
}
//if (tempDepartment != null)
//{
// if (tempDepartment.ParentID != null)
// {
// for (int i = (int)tempDepartment.Tier; i > 0; i--)
// {
// if (i == 5)
// {
// tire5 = oDepartment.Find(x => x.ID == tempDepartment.ID);
// }
// if (i == 4)
// {
// if (tire5 != null)
// {
// tire4 = oDepartment.Find(x => x.ID == tire5.ParentID);
// }
// else
// {
// tire4 = oDepartment.Find(x => x.ID == tempDepartment.ID);
// }
// }
// if (i == 3)
// {
// if (tire4 != null)
// {
// tire3 = oDepartment.Find(x => x.ID == tire4.ParentID);
// }
// else
// {
// tire3 = oDepartment.Find(x => x.ID == tempDepartment.ID);
// }
// }
// if (i == 2)
// {
// if (tire3 != null)
// {
// tire2 = oDepartment.Find(x => x.ID == tire3.ParentID);
// }
// else
// {
// tire2 = oDepartment.Find(x => x.ID == tempDepartment.ID);
// }
// }
// if (i == 1)
// {
// if (tire2 != null)
// {
// tire1 = oDepartment.Find(x => x.ID == tire2.ParentID);
// }
// else
// {
// tire1 = oDepartment.Find(x => x.ID == tempDepartment.ID);
// }
// }
// }
// }
// temp.deptireOne = (tire1 == null) ? "" : tire1.Name;
// temp.deptireTwo = (tire2 == null) ? "" : tire2.Name;
// temp.deptireThree = (tire3 == null) ? "" : tire3.Name;
// temp.deptireFour = (tire4 == null) ? "" : tire4.Name;
// temp.deptireFive = (tire5 == null) ? "" : tire5.Name;
//}
temp.deptireOne = (tire1 == null) ? "" : tire1.Name;
temp.deptireTwo = (tire2 == null) ? "" : tire2.Name;
temp.deptireThree = (tire3 == null) ? "" : tire3.Name;
temp.deptireFour = (tire4 == null) ? "" : tire4.Name;
temp.deptireFive = (tire5 == null) ? "" : tire5.Name;
}
temp.Designation = row["DESIGNATION"] == null ? "" : row.Field<string>("DESIGNATION");
temp.Grade = row["GRADE"] == null ? "" : row.Field<string>("GRADE");
temp.Designation = row["DESIGNATION"] == null ? "" : row.Field<string>("DESIGNATION");