コード例 #1
0
        /// <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;
            }
        }
コード例 #2
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);
            }
        }
コード例 #3
0
        /// <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;
            }
        }