Exemple #1
0
        public long AddUnit(HostingUnit hostingUnit)
        {
            HostingUnit hostingUnitCopy = (HostingUnit)hostingUnit.Clone();

            hostingUnitCopy.HostingUnitKey = XC.GetConfiguration <long>("HostUnitKey");
            DataSource.HostingUnitsCollection.Add(hostingUnitCopy);
            XmlDataSource.SaveToXML <List <HostingUnit> >(DataSource.HostingUnitsCollection, HostingUnitPath);
            XC.UpdateConfiguration <long>("HostUnitKey", (hostingUnitCopy.HostingUnitKey + 1));
            return(hostingUnitCopy.HostingUnitKey);
            //XH.AddUnit(hostingUnit);
        }
Exemple #2
0
        public bool AddHostingUnit(HostingUnit hostingUnit)
        {
            HostingUnit hostingUnitCopy = (HostingUnit)hostingUnit.Clone();

            hostingUnitCopy.HostingUnitKey = XC.GetConfiguration <int>("HostUnitKey");
            List <HostingUnit> unitList = Lunit();

            unitList.Add(hostingUnitCopy);
            XmlDataSource.SaveToXML <List <HostingUnit> >(unitList, HostingUnitPath);
            XC.UpdateConfiguration <int>("HostUnitKey", (hostingUnitCopy.HostingUnitKey + 1));
            return(true);
        }
        public void AddOrder(Order order)
        {
            long key = XC.GetConfiguration <long>("OrderKey");

            OrderRoot.Add(new XElement("Order",
                                       new XElement("OrderKey", key),
                                       new XElement("HostingUnitKey", order.HostingUnitKey),
                                       new XElement("GuestRequestKey", order.GuestRequestKey),
                                       new XElement("Status", order.Status),
                                       new XElement("CreateDate", order.CreateDate),
                                       new XElement("OrderDate", order.OrderDate),
                                       new XElement("CommissionValue", order.CommissionValue)));
            OrderRoot.Save(OrderPath);
            XC.UpdateConfiguration <long>("OrderKey", ++key);
        }
Exemple #4
0
        public void AddOrder(Order order)
        {
            order.OrderKey = (int)XC.GetConfiguration <long>("OrderKey");

            OrderRoot.Add(new XElement("Order",
                                       new XElement("OrderKey", order.OrderKey),
                                       new XElement("HostingUnitKey", order.HostingUnitKey),
                                       new XElement("GuestRequestKey", order.GuestRequestKey),
                                       new XElement("Status", order.StatusOrder),
                                       new XElement("CreateDate", order.CreateDate.ToShortDateString()),
                                       new XElement("OrderDate", order.OrderDate.ToShortDateString())
                                       /*new XElement("CommissionValue", order.CommissionValue)*/));
            OrderRoot.Save(OrderPath);
            XC.UpdateConfiguration <long>("OrderKey", order.OrderKey + 1);//run
        }