Esempio n. 1
0
        protected override MenuItem ProcessRecord(Record record)
        {
            if (record["MenuItemId"] == DBNull.Value)
            {
                return(null);
            }

            MenuItem item = new MenuItem()
            {
                Id            = (int)record["MenuItemId"],
                Name          = (string)record["MenuItemName"],
                Price         = (decimal)record["Price"],
                VAT           = (int)record["VAT"],
                AmountInStock = (int)record["InStock"],
                Type          = (string)record["Type"],
                Subtype       = (string)record["SubType"],
                Comment       = null,
            };

            if (record.ContainsKey("Comment"))
            {
                item.Comment = record["Comment"] != DBNull.Value ? (string)record["Comment"] : null;
            }

            return(item);
        }
Esempio n. 2
0
        protected override Order ProcessRecord(Record record)
        {
            Staff staff = null;

            if (record["StaffNumber"] != DBNull.Value)
            {
                staff = new Staff()
                {
                    Id   = (int)record["StaffNumber"],
                    Name = (string)record["StaffName"],
                    Salt = (int)record["StaffSalt"],
                    Role = (string)record["StaffRole"]
                };
            }

            Order order = new Order()
            {
                Id       = (int)record["OrderId"],
                PlacedBy = staff,
                PlacedAt = (DateTime)record["OrderPlacedDateTime"],
                Tag      = null,
                Status   = (string)record["Status"],
            };

            if (record.ContainsKey("Tag"))
            {
                order.Tag = record["Tag"] != DBNull.Value ? (string)record["Tag"] : null;
            }
            return(order);
        }