Ejemplo n.º 1
0
        private static DataMicroBiology LoadFromXmlVer1(XmlNode root, DataBase par, ReceptVersion curVer)
        {
            DataMicroBiology ret = new DataMicroBiology(par);

            ret.BeginUpdate();
            ret.Id = int.Parse(root.Attributes["id"].Value, CultureInfo.CurrentCulture);
            foreach (XmlNode curNode in root.ChildNodes)
            {
                switch (curNode.Name)
                {
                case "name":
                    ret.Name = curNode.InnerText;
                    break;

                case "comment":
                    ret.Comment = curNode.InnerText;
                    break;

                case "items":
                    foreach (XmlNode itemNode in curNode.ChildNodes)
                    {
                        ret.Components.Add(DataMicroBiologyIndicator.LoadFromXml(itemNode, ret, curVer));
                    }
                    break;
                }
            }
            ret.EndUpdate(false);
            ret.IsChanged = false;
            return(ret);
        }
Ejemplo n.º 2
0
        public static BindingList <RecordProperty> ItemsMicroBiology(DataMicroBiology curRec)
        {
            BindingList <RecordProperty> ret = new BindingList <RecordProperty>();
            RecordProperty np = new RecordProperty();

            np.Name       = "name";
            np.ObjectType = TypeCode.String;

            return(ret);
        }
Ejemplo n.º 3
0
 internal DataMicroBiology FindMicroBiology(DataMicroBiology curRec)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 internal void AddMicroBiologyStruct(DataMicroBiology curRec)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// загрузка файла версии программы "2"
        /// </summary>
        /// <param name="curnode">узел дерева XML</param>
        /// <param name="par">родительский объект</param>
        /// <returns>структуру данных рецептуры</returns>
        private static DataRecept LoadFromXmlVer1(XmlNode curnode, DataBase par, ReceptVersion curVer)
        {
            DataRecept curRec = new DataRecept(par);

            curRec.BeginUpdate();
            curRec.Id = int.Parse(curnode.Attributes["id"].Value, CultureInfo.CurrentCulture);
            foreach (XmlNode props in curnode.ChildNodes)
            {
                switch (props.Name)
                {
                case "color": curRec._color = props.InnerText; break;

                case "components": curRec.Components.AddRange(DataRaw.LoadManyFromXml(props, curRec, curVer)); break;

                case "consistence": curRec._consistence = props.InnerText; break;

                case "delivery": curRec._delivery = props.InnerText; break;

                case "design": curRec._design = props.InnerText; break;

                case "extView": curRec._extView = props.InnerText; break;

                case "totalLoss": curRec._totalLoss = DataTotalLoss.LoadFromXml(props, curRec, curVer); break;

                case "process": curRec._process = props.InnerText; break;

                case "sale": curRec._sale = props.InnerText; break;

                case "storage": curRec._storage = props.InnerText; break;

                case "taste": curRec._taste = props.InnerText; break;

                case "water": curRec._water = Convert.ToDecimal(props.InnerText, CultureInfo.CurrentCulture); break;

                case "waterPlus": curRec._waterPlus = Convert.ToDecimal(props.InnerText, CultureInfo.CurrentCulture); break;

                case "waterMinus": curRec._waterMinus = Convert.ToDecimal(props.InnerText, CultureInfo.CurrentCulture); break;

                case "acidity": curRec.myAcidity = Convert.ToDecimal(props.InnerText, CultureInfo.CurrentCulture); break;

                case "name": curRec.Name = props.InnerText; break;

                case "source": curRec._source = props.InnerText; break;

                case "normativDoc": curRec._normativDoc = props.InnerText; break;

                case "preview": curRec._preview = props.InnerText; break;

                case "quantity": curRec.Quantity = Convert.ToDecimal(props.InnerText, CultureInfo.CurrentCulture); break;

                case "totalExit": curRec.myTotalExit = Convert.ToDecimal(props.InnerText, CultureInfo.CurrentCulture); break;

                case "countExit": curRec.myCountExit = Convert.ToDecimal(props.InnerText, CultureInfo.CurrentCulture); break;

                case "microbiology": curRec.myMicroBiology = DataMicroBiology.LoadFromXml(props, curRec, curVer); break;

                case "isCalcExit": curRec.myIsCalcExit = Convert.ToBoolean(props.InnerText, CultureInfo.CurrentCulture); break;

                case "isCalcWater": curRec.myIsCalcWater = Convert.ToBoolean(props.InnerText, CultureInfo.CurrentCulture); break;

                case "isSetWater": curRec.myIsSetWater = Convert.ToBoolean(props.InnerText, CultureInfo.CurrentCulture); break;
                }
            }
            curRec.IsChanged = false;
            curRec.EndUpdate(false);
            return(curRec);
        }