internal List <Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO> ToList(IEnumerable <Indico.DAL.WeeklyProductionCapacityDetails> oQuery)
        {
            List <Indico.DAL.WeeklyProductionCapacityDetails> oList = oQuery.ToList();
            List <Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO> rList = new List <Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO>(oList.Count);

            foreach (Indico.DAL.WeeklyProductionCapacityDetails o in oList)
            {
                Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO obj = new Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO(o, ref this._context);
                rList.Add(obj);
            }
            return(rList);
        }
        public bool GetObject(bool blnCache)
        {
            Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO data = null;

            if (blnCache)
            {
                data = this.GetFromCache(this.ID) as Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO;
            }

            if (data != null)
            {
                SetBO(data);
            }
            else
            {
                try
                {
                    IndicoEntities context = (this.Context != null) ? this.Context.Context : new IndicoEntities();
                    IQueryable <Indico.DAL.WeeklyProductionCapacityDetails> oQuery =
                        from o in context.WeeklyProductionCapacityDetails
                        where o.ID == this.ID
                        select o;

                    List <Indico.DAL.WeeklyProductionCapacityDetails> oList = oQuery.ToList();
                    if (oList.Count != 1)
                    {
                        return(false);
                    }
                    else
                    {
                        SetBO(oList[0]);
                        this.Cache();
                    }

                    if (this.Context == null)
                    {
                        context.Dispose();
                    }
                }
                catch (System.Exception e)
                {
                    throw new IndicoException(String.Format(System.Globalization.CultureInfo.InvariantCulture, ResourceManager.GetString("Could not Retrieve a {0} from the data store", System.Globalization.CultureInfo.CurrentCulture), this.ToString()), e, IndicoException.Severities.USER, IndicoException.ERRNO.INT_ERR_BO_SELECT_FAIL);
                }
            }
            return(true);
        }
        internal void SetBO(Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO obj)
        {
            this._doNotUpdateDALObject = true;

            // set this Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO properties
            this.ID = obj.ID;

            this.Efficiency               = obj.Efficiency;
            this.FivePcsCapacity          = obj.FivePcsCapacity;
            this.ItemType                 = obj.ItemType;
            this.SampleCapacity           = obj.SampleCapacity;
            this.TotalCapacity            = obj.TotalCapacity;
            this.WeeklyProductionCapacity = obj.WeeklyProductionCapacity;
            this.Workers = obj.Workers;

            this._doNotUpdateDALObject = false;
        }
        /// <summary>
        /// Deserializes Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO object from an XML representation
        /// </summary>
        /// <param name="strXML">a XML string serialized representation</param>
        public Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO DeserializeObject(string strXML)
        {
            Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO objTemp = null;
            System.Xml.XmlDocument objXML = new System.Xml.XmlDocument();

            objXML.LoadXml(strXML);
            System.Text.Encoding encoding = System.Text.Encoding.UTF8;

            System.IO.MemoryStream objStream = new System.IO.MemoryStream();
            byte[] b = encoding.GetBytes(objXML.OuterXml);

            objStream.Write(b, 0, (int)b.Length);
            objStream.Position = 0;
            System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(this.GetType());

            objTemp = (Indico.BusinessObjects.WeeklyProductionCapacityDetailsBO)x.Deserialize(objStream);
            objStream.Close();
            return(objTemp);
        }