public bool Save(SortingLine sortingLine) { var sortLineSave = SortingLineRepository.GetQueryable().FirstOrDefault(s => s.SortingLineCode == sortingLine.SortingLineCode); sortLineSave.SortingLineName = sortingLine.SortingLineName; sortLineSave.SortingLineType = sortingLine.SortingLineType; sortLineSave.OutBillTypeCode = sortingLine.OutBillTypeCode; sortLineSave.MoveBillTypeCode = sortingLine.MoveBillTypeCode; sortLineSave.CellCode = sortingLine.CellCode; sortLineSave.IsActive = sortingLine.IsActive; sortLineSave.UpdateTime = DateTime.Now; SortingLineRepository.SaveChanges(); return(true); }
public bool Delete(string sortingLineCode) { var sortLine = SortingLineRepository.GetQueryable() .FirstOrDefault(s => s.SortingLineCode == sortingLineCode); if (sortLine != null) { SortingLineRepository.Delete(sortLine); SortingLineRepository.SaveChanges(); } else { return(false); } return(true); }
public new bool Add(SortingLine sortingLine) { var sortLine = new SortingLine(); sortLine.SortingLineCode = sortingLine.SortingLineCode; sortLine.SortingLineName = sortingLine.SortingLineName; sortLine.SortingLineType = sortingLine.SortingLineType; sortLine.OutBillTypeCode = sortingLine.OutBillTypeCode; sortLine.MoveBillTypeCode = sortingLine.MoveBillTypeCode; sortLine.CellCode = sortingLine.CellCode; sortLine.IsActive = sortingLine.IsActive; sortLine.UpdateTime = DateTime.Now; SortingLineRepository.Add(sortLine); SortingLineRepository.SaveChanges(); return(true); }