| | |
| | | throw new NotImplementedException("插入失败"); |
| | | } |
| | | |
| | | private bool DeleteItemType(decimal id) |
| | | private bool DeleteItemType(long? id) |
| | | { |
| | | var deleteById = Db.Deleteable<MesItemType>() |
| | | .Where(it => it.Id == id).ExecuteCommand(); |
| | |
| | | |
| | | private MesItemType GetMesItemType(ErpItemType department) |
| | | { |
| | | return new MesItemType |
| | | var entity = new MesItemType |
| | | { |
| | | Id = Convert.ToDecimal(department.Id), |
| | | Id = string.IsNullOrEmpty(department.Id) |
| | | ? DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| | | : long.Parse(department.Id), |
| | | Pgroup = department.FParentId, |
| | | Tcode = department.FNumber, |
| | | Tname = department.FName, |
| | |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | |
| | | var mesItemType = Db.Queryable<MesItemType>() |
| | | .Where(it => it.Tcode == entity.Tcode) |
| | | .First(); |
| | | |
| | | if (mesItemType != null) |
| | | { |
| | | entity.Id = mesItemType.Id; |
| | | } |
| | | |
| | | return entity; |
| | | } |
| | | |
| | | public bool SaveList(List<ErpItemType> departments) |