/// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ID = (long)dataRow["ID"];
            this.StockOutputOrderItemID         = (int)dataRow["StockOutputOrderItemID"];
            this.StockOutputOrderID             = (int)dataRow["StockOutputOrderID"];
            this.ComponentID                    = (int)dataRow["ComponentID"];
            this.RobotArticleCode               = (string)dataRow["RobotArticleCode"];
            this.RobotArticleName               = (string)dataRow["RobotArticleName"];
            this.RobotArticleDosageForm         = (string)dataRow["RobotArticleDosageForm"];
            this.RobotArticlePackagingUnit      = (string)dataRow["RobotArticlePackagingUnit"];
            this.RobotArticleMaxSubItemQuantity = (int)dataRow["RobotArticleMaxSubItemQuantity"];
            this.BatchNumber                    = (string)dataRow["BatchNumber"];
            this.DeliveryNumber                 = (string)dataRow["DeliveryNumber"];
            this.ExpiryDate      = (DateTime)dataRow["ExpiryDate"];
            this.ExternalID      = (string)dataRow["ExternalID"];
            this.BoxNumber       = (string)dataRow["BoxNumber"];
            this.IsInFridge      = (bool)dataRow["IsInFridge"];
            this.Shape           = (PackShape)Enum.Parse(typeof(PackShape), (string)dataRow["Shape"]);
            this.SubItemQuantity = (int)dataRow["SubItemQuantity"];
            this.ScanCode        = (string)dataRow["ScanCode"];
            this.StockInDate     = (DateTime)dataRow["StockInDate"];
            this.Depth           = (int)dataRow["Depth"];
            this.Height          = (int)dataRow["Height"];
            this.Width           = (int)dataRow["Width"];
            this.OutputNumber    = (int)dataRow["OutputNumber"];
            this.OutputPoint     = (int)dataRow["OutputPoint"];
            this.LabelState      = (StockOutputOrderItemPackLabelState)Enum.Parse(typeof(StockOutputOrderItemPackLabelState), (string)dataRow["LabelState"]);

            this.TenantID                 = (string)dataRow["TenantID"];
            this.TenantDescription        = (string)dataRow["TenantDescription"];
            this.StockLocationID          = (string)dataRow["StockLocationID"];
            this.StockLocationDescription = (string)dataRow["StockLocationDescription"];
            this.MachineLocation          = (string)dataRow["MachineLocation"];
        }
        /// <summary>
        /// Updates the article information of this item pack.
        /// </summary>
        /// <param name="database">The database to retrieve the article information from.</param>
        public void UpdateArticleInformation(DB.Database database)
        {
            if (database == null)
            {
                throw new ArgumentException("Invalid database specified.");
            }

            if ((this.RobotArticleID == 0) || (this.ComponentID == 0))
            {
                this.RobotArticleCode          = string.Empty;
                this.RobotArticleName          = string.Empty;
                this.RobotArticleDosageForm    = string.Empty;
                this.RobotArticlePackagingUnit = string.Empty;
            }
            else
            {
                var articleList = database.Query <RobotArticle>(new CommandFilter("ID", this.RobotArticleID),
                                                                new CommandFilter("ComponentID", this.ComponentID));

                if (articleList.Count == 0)
                {
                    this.Error("Article with ID '{0}' for component '{1}' not found.", this.RobotArticleID, this.ComponentID);

                    this.RobotArticleCode          = this.ScanCode == null ? string.Empty : this.ScanCode;
                    this.RobotArticleName          = string.Empty;
                    this.RobotArticleDosageForm    = string.Empty;
                    this.RobotArticlePackagingUnit = string.Empty;
                }

                this.RobotArticleCode          = articleList[0].Code;
                this.RobotArticleName          = articleList[0].Name;
                this.RobotArticleDosageForm    = articleList[0].DosageForm;
                this.RobotArticlePackagingUnit = articleList[0].PackagingUnit;
            }
        }
Пример #3
0
        // Change the username; pUser should contain the new username! Change it later?
        public Boolean databaseOperation(user pUser, string pConnectionString)
        {
            var connection = new SQLiteConnection(pConnectionString);

            connection.Open();

            Database db = new DB.Database(@"URI=file:C:\Users\Michael Distler\source\repos\WPF_Login\test.db");

            // Check if username already exists
            if (db.userMgt(pUser, "CheckUserNameExists"))
            {
                return(false);
            }
            else
            {
                var command = new SQLiteCommand(connection);
                command.CommandText = "UPDATE user SET user_name = @user_name WHERE user_id = @user_id";
                command.Parameters.AddWithValue("@user_name", pUser.getName());
                command.Parameters.AddWithValue("@user_id", pUser.getID());
                command.Prepare();

                command.ExecuteNonQuery();

                connection.Close();

                return(true);
            }
        }
Пример #4
0
        /// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ID          = (int)dataRow["ID"];
            this.ComponentID = (int)dataRow["ComponentID"];
            this.TenantID    = (string)dataRow["TenantID"];

            object id = dataRow["ParentOrderID"];

            this.ParentOrderID = (id == DBNull.Value) ? 0 : (int)id;

            id = dataRow["ParentComponentID"];
            this.ParentComponentID = (id == DBNull.Value) ? 0 : (int)id;

            id = dataRow["ParentTenantID"];
            this.ParentTenantID = (id == DBNull.Value) ? null : (string)id;

            this.SourceID       = (int)dataRow["SourceID"];
            this.OrderNumber    = (string)dataRow["OrderNumber"];
            this.BoxNumber      = (string)dataRow["BoxNumber"];
            this.ExternalNumber = (string)dataRow["ExternalNumber"];
            this.OutputNumber   = (int)dataRow["OutputNumber"];
            this.OutputPoint    = (int)dataRow["OutputPoint"];
            this.Priority       = (int)dataRow["Priority"];
            this.State          = (StockOutputOrderState)Enum.Parse(typeof(StockOutputOrderState), (string)dataRow["State"]);
            this.Created        = ((DateTime)dataRow["Created"]).ToUniversalTime();

            if (dataRow.Table.Columns.Contains("HistoryDate"))
            {
                this.HistoryDate = ((DateTime)dataRow["HistoryDate"]).ToUniversalTime();
            }

            _requireLazyLoad = true;
            _database        = database;
        }
        /// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ID = (int)dataRow["ID"];
            this.StockOutputOrderID       = (int)dataRow["StockOutputOrderID"];
            this.ComponentID              = (int)dataRow["ComponentID"];
            this.TenantID                 = (string)dataRow["TenantID"];
            this.PackID                   = (long)dataRow["PackID"];
            this.PISArticleCode           = (string)dataRow["PisArticleCode"];
            this.RobotArticleCode         = (string)dataRow["RobotArticleCode"];
            this.RobotArticleName         = (string)dataRow["RobotArticleName"];
            this.BatchNumber              = (string)dataRow["BatchNumber"];
            this.SingleBatchNumber        = (bool)dataRow["SingleBatchNumber"];
            this.ExternalID               = (string)dataRow["ExternalID"];
            this.ExpiryDate               = (DateTime)dataRow["ExpiryDate"];
            this.StockLocationID          = (string)dataRow["StockLocationID"];
            this.MachineLocation          = (string)dataRow["MachineLocation"];
            this.RequestedQuantity        = (int)dataRow["RequestedQuantity"];
            this.ProcessedQuantity        = (int)dataRow["ProcessedQuantity"];
            this.RequestedSubItemQuantity = (int)dataRow["RequestedSubItemQuantity"];
            this.ProcessedSubItemQuantity = (int)dataRow["ProcessedSubItemQuantity"];

            if (dataRow.Table.Columns.Contains("HistoryDate"))
            {
                _historyDate = ((DateTime)dataRow["HistoryDate"]).ToUniversalTime();
            }

            _lazyLoadPacks  = true;
            _lazyLoadLabels = true;
            _database       = database;
        }
Пример #6
0
        /// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ID = (int)dataRow["ID"];
            this.ParentPisArticleID = (dataRow["ParentPisArticleID"] != System.DBNull.Value) ? (int?)dataRow["ParentPisArticleID"] : null;
            this.TenantID           = (string)dataRow["TenantID"];
            this.Code               = (string)dataRow["Code"];
            this.Name               = (string)dataRow["Name"];
            this.DosageForm         = (string)dataRow["DosageForm"];
            this.PackagingUnit      = (string)dataRow["PackagingUnit"];
            this.MaxSubItemQuantity = (int)dataRow["MaxSubItemQuantity"];

            if (dataRow["RobotArticleCode"] != System.DBNull.Value)
            {
                this.RobotArticleCode = (string)dataRow["RobotArticleCode"];
            }

            this.StockLocationID = (string)dataRow["StockLocationID"];
            this.MachineLocation = (string)dataRow["MachineLocation"];

            this.BatchTracking  = (bool)dataRow["BatchTracking"];
            this.SerialTracking = (bool)dataRow["SerialTracking"];
            this.ExpiryTracking = (bool)dataRow["ExpiryTracking"];

            _attributesRequireLazyLoad = true;
            _scanCodeRequireLazyLoad   = true;
            _database = database;
        }
        /// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ID = (int)dataRow["ID"];
            this.StockDeliveryID    = (int)dataRow["StockDeliveryID"];
            this.TenantID           = (string)dataRow["TenantID"];
            this.ArticleCode        = (string)dataRow["ArticleCode"];
            this.BatchNumber        = (string)dataRow["BatchNumber"];
            this.ExternalID         = (string)dataRow["ExternalID"];
            this.Name               = (string)dataRow["Name"];
            this.DosageForm         = (string)dataRow["DosageForm"];
            this.PackagingUnit      = (string)dataRow["PackagingUnit"];
            this.RequiresFridge     = (bool)dataRow["RequiresFridge"];
            this.ExpiryDate         = (DateTime)dataRow["ExpiryDate"];
            this.MaxSubItemQuantity = (int)dataRow["MaxSubItemQuantity"];
            this.RequestedQuantity  = (int)dataRow["RequestedQuantity"];
            this.ProcessedQuantity  = (int)dataRow["ProcessedQuantity"];
            this.StockLocationID    = (string)dataRow["StockLocationID"];
            this.MachineLocation    = (string)dataRow["MachineLocation"];

            if (dataRow.Table.Columns.Contains("HistoryDate"))
            {
                _historyDate = ((DateTime)dataRow["HistoryDate"]).ToUniversalTime();
            }

            _lazyLoadPacks = true;
            _database      = database;
        }
Пример #8
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.PisArticleID = (int)dataRow["PisArticleID"];
     this.TenantID     = (string)dataRow["TenantID"];
     this.Name         = (string)dataRow["Name"];
     this.Value        = (string)dataRow["Value"];
 }
Пример #9
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public virtual void Load(DataRow dataRow, DB.Database database)
 {
     this.ID               = (int)dataRow["ID"];
     this.RobotArticleID   = (int)dataRow["RobotArticleID"];
     this.ComponentID      = (int)dataRow["ComponentID"];
     this.RobotArticleCode = (string)dataRow["RobotArticleCode"];
     this.BatchNumber      = (string)dataRow["BatchNumber"];
     this.DeliveryNumber   = (string)dataRow["DeliveryNumber"];
     this.ExpiryDate       = (DateTime)dataRow["ExpiryDate"];
     this.ExternalID       = (string)dataRow["ExternalID"];
     this.IsInFridge       = (bool)dataRow["IsInFridge"];
     this.Shape            = (PackShape)Enum.Parse(typeof(PackShape), (string)dataRow["Shape"]);
     this.SubItemQuantity  = (int)dataRow["SubItemQuantity"];
     this.ScanCode         = (string)dataRow["ScanCode"];
     this.StockInDate      = (DateTime)dataRow["StockInDate"];
     this.Depth            = (int)dataRow["Depth"];
     this.Height           = (int)dataRow["Height"];
     this.Width            = (int)dataRow["Width"];
     this.IsAvailable      = (bool)dataRow["IsAvailable"];
     this.IsBlocked        = (bool)dataRow["IsBlocked"];
     this.IsOnline         = (bool)dataRow["IsOnline"];
     this.StockLocationID  = (string)dataRow["StockLocationID"];
     this.TenantID         = (string)dataRow["TenantID"];
     this.MachineLocation  = (string)dataRow["MachineLocation"];
 }
Пример #10
0
        /// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ComponentID = (int)dataRow["ComponentID"];
            this.Name        = (string)dataRow["Name"];
            object rowValue = dataRow["Value"];

            this.Value = (rowValue != DBNull.Value) ? (string)rowValue : string.Empty;
        }
Пример #11
0
 /// <summary>
 /// Loads the content of the data type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the data type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID            = (string)dataRow["ID"];
     this.ComponentID   = (int)dataRow["ComponentID"];
     this.Description   = (string)dataRow["Description"];
     this.TotalCapacity = (int)dataRow["TotalCapacity"];
     this.UsedCapacity  = (int)dataRow["UsedCapacity"];
 }
Пример #12
0
        /// <summary>
        /// Loads the attribute from related PIS ID.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DB.Database _database, int pisArticleID)
        {
            List <PisArticleAttribute> unsortedAttribute = _database.Query <PisArticleAttribute>(new CommandFilter("PisArticleID", pisArticleID));

            foreach (PisArticleAttribute attribute in unsortedAttribute)
            {
                _attributes.Add(attribute.Name, attribute);
            }
        }
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID = (int)dataRow["ID"];
     this.StockOutputOrderItemID = (int)dataRow["StockOutputOrderItemID"];
     this.StockOutputOrderID     = (int)dataRow["StockOutputOrderID"];
     this.ComponentID            = (int)dataRow["ComponentID"];
     this.TenantID   = (string)dataRow["TenantID"];
     this.TemplateID = (string)dataRow["TemplateID"];
     this.Content    = (string)dataRow["Content"];
 }
Пример #14
0
 /// <summary>
 /// Loads the content of the data type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the data type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.Number = (int)dataRow["Number"];
     this.NumberInConveyorSystem = (int)dataRow["NumberInConveyorSystem"];
     this.Name                   = (string)dataRow["Name"];
     this.Description            = (string)dataRow["Description"];
     this.ExternalIdentifier     = (string)dataRow["ExternalIdentifier"];
     this.AreSpecialPacksAllowed = (bool)dataRow["AreSpecialPacksAllowed"];
     this.IsTrash                = (bool)dataRow["IsTrash"];
     this.IsDisabled             = (bool)dataRow["IsDisabled"];
 }
Пример #15
0
        /// <summary>
        /// Loads the content of the data type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the data type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ID          = (int)dataRow["ID"];
            this.Type        = (ComponentType)Enum.Parse(typeof(ComponentType), (string)dataRow["Type"]);
            this.Assembly    = (string)dataRow["Assembly"];
            this.ClassName   = (string)dataRow["ClassName"];
            this.Description = (string)dataRow["Description"];
            this.IsActive    = (bool)dataRow["IsActive"];

            object idValue = dataRow["ConnectedComponentID"];

            this.ConnectedComponentID = (idValue != DBNull.Value) ? (int)idValue : 0;
        }
Пример #16
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID                 = (int)dataRow["ID"];
     this.TenantID           = (string)dataRow["TenantID"];
     this.Code               = (string)dataRow["Code"];
     this.Name               = (string)dataRow["Name"];
     this.DosageForm         = (string)dataRow["DosageForm"];
     this.PackagingUnit      = (string)dataRow["PackagingUnit"];
     this.RequiresFridge     = (bool)dataRow["RequiresFridge"];
     this.MaxSubItemQuantity = (int)dataRow["MaxSubItemQuantity"];
     this.StockLocationID    = (string)dataRow["StockLocationID"];
     this.MachineLocation    = (string)dataRow["MachineLocation"];
 }
Пример #17
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID                 = (int)dataRow["ID"];
     this.ComponentID        = (int)dataRow["ComponentID"];
     this.Code               = (string)dataRow["Code"];
     this.Name               = (string)dataRow["Name"];
     this.DosageForm         = (string)dataRow["DosageForm"];
     this.PackagingUnit      = (string)dataRow["PackagingUnit"];
     this.RequiresFridge     = (bool)dataRow["RequiresFridge"];
     this.IsAvailable        = (bool)dataRow["IsAvailable"];
     this.IsBlocked          = (bool)dataRow["IsBlocked"];
     this.MaxSubItemQuantity = (int)dataRow["MaxSubItemQuantity"];
 }
Пример #18
0
        private void btnNewPassword_Click(object sender, RoutedEventArgs e)
        {
            user currentUser = (user)App.Current.Properties["currentUser"];

            currentUser.setPassword(tboxNewPassword.Text);

            DB.Database db = new DB.Database(@"URI=file:C:\Users\Michael Distler\source\repos\WPF_Login\test.db");

            db.userMgt(currentUser, "ChangePassword"); // SPÄTER ERSETZEN
            //if(db.userMgt(currentUser, "ChangeUsername"))
            //{
            //    MELDUNG ÜBER NEUES LABEL
            //}
        }
Пример #19
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID                       = (string)dataRow["ID"];
     this.Code                     = (string)dataRow["Code"];
     this.Name                     = (string)dataRow["Name"];
     this.Type                     = (string)dataRow["Type"];
     this.Unit                     = (string)dataRow["Unit"];
     this.IsFridge                 = (bool)dataRow["IsFridge"];
     this.Depth                    = (int)dataRow["Depth"];
     this.Height                   = (int)dataRow["Height"];
     this.Width                    = (int)dataRow["Width"];
     this.PackCount                = (int)dataRow["PackCount"];
     this.TenantID                 = (string)dataRow["TenantID"];
     this.TenantDescription        = (string)dataRow["TenantDescription"];
     this.StockLocationID          = (string)dataRow["StockLocationID"];
     this.StockLocationDescription = (string)dataRow["StockLocationDescription"];
 }
Пример #20
0
        /// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public void Load(DataRow dataRow, DB.Database database)
        {
            this.ID             = (int)dataRow["ID"];
            this.SourceID       = (int)dataRow["SourceID"];
            this.DeliveryNumber = (string)dataRow["DeliveryNumber"];
            this.BoxNumber      = (string)dataRow["BoxNumber"];
            this.Priority       = (StockDeliveryPriority)Enum.Parse(typeof(StockDeliveryPriority), (string)dataRow["Priority"]);
            this.State          = (StockDeliveryState)Enum.Parse(typeof(StockDeliveryState), (string)dataRow["State"]);
            this.Created        = ((DateTime)dataRow["Created"]).ToUniversalTime();
            this.TenantID       = (string)dataRow["TenantID"];

            if (dataRow.Table.Columns.Contains("HistoryDate"))
            {
                this.HistoryDate = ((DateTime)dataRow["HistoryDate"]).ToUniversalTime();
            }

            _requireLazyLoad = true;
            _database        = database;
        }
        /// <summary>
        /// Loads the content of the database type from the specified database row object.
        /// </summary>
        /// <param name="dataRow">The database row object to load the database type from.</param>
        /// <param name="database">The database instance to use for loading additional dependencies.</param>
        public override void Load(DataRow dataRow, DB.Database database)
        {
            base.Load(dataRow, database);

            this.Name               = (string)dataRow["Name"];
            this.DosageForm         = (string)dataRow["DosageForm"];
            this.PackagingUnit      = (string)dataRow["PackagingUnit"];
            this.RequiresFridge     = (bool)dataRow["RequiresFridge"];
            this.MaxSubItemQuantity = (int)dataRow["MaxSubItemQuantity"];

            var tmp = dataRow["StockLocationDescription"];

            this.StockLocationDescription = (tmp == DBNull.Value) ? string.Empty : (string)tmp;

            tmp = dataRow["TenantDescription"];
            this.TenantDescription = (tmp == DBNull.Value) ? string.Empty : (string)tmp;

            if (dataRow.Table.Columns.Contains("NumRows"))
            {
                this.PackCount = (long)dataRow["NumRows"];
            }
        }
Пример #22
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID = (long)dataRow["ID"];
     this.StockDeliveryItemID = (int)dataRow["StockDeliveryItemID"];
     this.StockDeliveryID     = (int)dataRow["StockDeliveryID"];
     this.TenantID            = (string)dataRow["TenantID"];
     this.BatchNumber         = (string)dataRow["BatchNumber"];
     this.ExpiryDate          = (DateTime)dataRow["ExpiryDate"];
     this.ExternalID          = (string)dataRow["ExternalID"];
     this.IsInFridge          = (bool)dataRow["IsInFridge"];
     this.Shape                    = (PackShape)Enum.Parse(typeof(PackShape), (string)dataRow["Shape"]);
     this.SubItemQuantity          = (int)dataRow["SubItemQuantity"];
     this.ScanCode                 = (string)dataRow["ScanCode"];
     this.StockInDate              = (DateTime)dataRow["StockInDate"];
     this.Depth                    = (int)dataRow["Depth"];
     this.Width                    = (int)dataRow["Width"];
     this.Height                   = (int)dataRow["Height"];
     this.TenantID                 = (string)dataRow["TenantID"];
     this.TenantDescription        = (string)dataRow["TenantDescription"];
     this.StockLocationID          = (string)dataRow["StockLocationID"];
     this.StockLocationDescription = (string)dataRow["StockLocationDescription"];
     this.MachineLocation          = (string)dataRow["MachineLocation"];
 }
        /// <summary>
        /// Updates the stock location and tenant information of this item pack.
        /// </summary>
        /// <param name="database">The database to retrieve the stock location and tenant information from.</param>
        public void UpdateLocationAndTenantInformation(DB.Database database)
        {
            if (database == null)
            {
                throw new ArgumentException("Invalid database specified.");
            }

            var tenants = database.Query <Tenant>(new CommandFilter("ID", this.TenantID),
                                                  new CommandFilter("ComponentID", this.ComponentID));

            if (tenants.Count > 0)
            {
                this.TenantDescription = tenants[0].Description;
            }

            var locations = database.Query <StockLocation>(new CommandFilter("ID", this.StockLocationID),
                                                           new CommandFilter("ComponentID", this.ComponentID));

            if (locations.Count > 0)
            {
                this.StockLocationDescription = locations[0].Description;
            }
        }
Пример #24
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public virtual void Load(DataRow dataRow, DB.Database database)
 {
     this.ID                       = (int)dataRow["ID"];
     this.ComponentID              = (int)dataRow["ComponentID"];
     this.ArticleName              = (string)dataRow["ArticleName"];
     this.ArticleCode              = (string)dataRow["ArticleCode"];
     this.Batch                    = (string)dataRow["Batch"];
     this.IsSpecial                = (bool)dataRow["IsSpecial"];
     this.IsFridge                 = (bool)dataRow["IsFridge"];
     this.EntryDate                = (DateTime)dataRow["EntryDate"];
     this.ExpiryDate               = (DateTime)dataRow["ExpiryDate"];
     this.SubItemQuantity          = (int)dataRow["SubItemQuantity"];
     this.ScanCode                 = (string)dataRow["ScanCode"];
     this.ExternalIdCode           = (string)dataRow["ExternalIdCode"];
     this.DeliveryNumber           = (string)dataRow["DeliveryNumber"];
     this.Depth                    = (int)dataRow["Depth"];
     this.Height                   = (int)dataRow["Height"];
     this.Width                    = (int)dataRow["Width"];
     this.StorageSystemName        = (string)dataRow["StorageSystemName"];
     this.TenantID                 = (string)dataRow["TenantID"];
     this.TenantDescription        = (string)dataRow["TenantDescription"];
     this.StockLocationID          = (string)dataRow["StockLocationID"];
     this.StockLocationDescription = (string)dataRow["StockLocationDescription"];
 }
Пример #25
0
 /// <summary>
 /// Loads the content of the data type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the data type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID          = (string)dataRow["ID"];
     this.ComponentID = (int)dataRow["ComponentID"];
     this.Description = (string)dataRow["Description"];
 }
Пример #26
0
 public HomeModel(DB.Database database, IHostingEnvironment env) : base(database)
 {
     environment   = env;
     dogController = new DogController(database, env.WebRootPath);
 }
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.ID                 = (string)dataRow["ID"];
     this.TenantID           = (string)dataRow["TenantID"];
     this.MaxSubItemQuantity = (int)dataRow["MaxSubItemQuantity"];
 }
Пример #28
0
 public UserPageModel(DB.Database db)
 {
     this.db = db;
 }
Пример #29
0
 /// <summary>
 /// Loads the content of the database type from the specified database row object.
 /// </summary>
 /// <param name="dataRow">The database row object to load the database type from.</param>
 /// <param name="database">The database instance to use for loading additional dependencies.</param>
 public void Load(DataRow dataRow, DB.Database database)
 {
     this.PisArticleID = (int)dataRow["PisArticleID"];
     this.TenantID     = (string)dataRow["TenantID"];
     this.ScanCode     = (string)dataRow["ScanCode"];
 }
Пример #30
0
 public AdoptModel(DB.Database db, IHostingEnvironment environment) : base(db)
 {
     dogController = new DogController(db, environment.WebRootPath);
 }