public MaterialPermitItem(MaterialPermit document, DbDataReader reader) { id = (int)reader["id"]; MaterialPermit = document; material = (string)reader["material"]; materialUnit = (string)reader["materialUnit"]; quantity = (decimal)reader["quantity"]; tonnage = (decimal)reader["tonnage"]; }
public MaterialPermitItem(MaterialPermit document) { id = -1; MaterialPermit = document; material = ""; materialUnit = "шт."; quantity = 1; tonnage = 0; Insert(); }
public static List <MaterialPermitItem> LoadList(MaterialPermit document, EPVDatabase database) { List <MaterialPermitItem> itemList = new List <MaterialPermitItem>(); QueryParameters parameters = new QueryParameters("document", document.Id); using (DbDataReader reader = database.ExecuteReader(QueryLoadList, parameters)) { while (reader.Read()) { itemList.Add(new MaterialPermitItem(document, reader)); } reader.Close(); } return(itemList); }
public static MaterialPermit Load(EPVDatabase database, int id) { MaterialPermit materialPermit = null; QueryParameters parameters = new QueryParameters("id", id); using (DbDataReader reader = database.ExecuteReader(LoadQuery, parameters)) { if (reader.Read()) { materialPermit = new MaterialPermit(reader); } reader.Close(); } if (materialPermit == null) { throw new ArgumentException(DispatcherService.Resources.Error.WrongIdentifier); } return(materialPermit); }
public MaterialPermit LoadCopy(EPVDatabase database) { return(MaterialPermit.Load(database, Id)); }