public List <UnitModelExpand> InitDeptExpand() { List <UnitModelExpand> listExpent = new List <UnitModelExpand>(); UnitModelExpand unitExpent = new UnitModelExpand(); List <UnitModel> lsUnit = sExtend.GetAllUnit(); List <DeptSupplyModel> lsDeptSupply = this.GetSpecialDeptName(); foreach (UnitModel un in lsUnit) { unitExpent = new UnitModelExpand(); foreach (DeptSupplyModel ds in lsDeptSupply) { if (ds.DeptCode.Equals(un.UnitCode)) { unitExpent.UnitName = un.UnitName; unitExpent.UnitCode = un.UnitCode + "A"; unitExpent.ExpandName = ds.SupplyName[0] + "£º "; listExpent.Add(unitExpent); unitExpent = new UnitModelExpand(); unitExpent.UnitName = un.UnitName; unitExpent.UnitCode = un.UnitCode + "B"; unitExpent.ExpandName = ds.SupplyName[1] + "£º "; listExpent.Add(unitExpent); } else { unitExpent.UnitCode = un.UnitCode; unitExpent.UnitName = un.UnitName; listExpent.Add(unitExpent); } } } return(listExpent); }
public List <UnitModelExpand> ChangeUnitModel() { List <UnitModelExpand> listExpent = new List <UnitModelExpand>(); UnitModelExpand unitExpent = new UnitModelExpand(); List <UnitModel> lsUnit = sExtend.GetAllUnit(); foreach (UnitModel um in lsUnit) { unitExpent = new UnitModelExpand(); unitExpent.UnitName = um.UnitName; unitExpent.UnitCode = um.UnitCode; listExpent.Add(unitExpent); } return(listExpent); }