예제 #1
0
 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"];
 }
예제 #2
0
        public MaterialPermitItem(MaterialPermit document)
        {
            id             = -1;
            MaterialPermit = document;
            material       = "";
            materialUnit   = "шт.";
            quantity       = 1;
            tonnage        = 0;

            Insert();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public MaterialPermit LoadCopy(EPVDatabase database)
 {
     return(MaterialPermit.Load(database, Id));
 }