Example #1
0
 public BackupClass(ClientList Clients, ProviderList Providers, ShipmentList Shipments, ProviderShipmentList ProviderShipment, PurchaseHistoryList PurchaseHistory)
 {
     this.Clients          = Clients;
     this.Providers        = Providers;
     this.Shipments        = Shipments;
     this.ProviderShipment = ProviderShipment;
     this.PurchaseHistory  = PurchaseHistory;
 }
Example #2
0
        private static void ProviderShipmentsIntoSQL(SQLiteConnection DataFile, ProviderShipmentList ProvShipList)
        {
            SQLiteCommand insert = new SQLiteCommand(DataFile);

            for (int i = 0; i < ProvShipList.Count; i++)
            {
                insert.CommandText = "insert into ProviderShipment values(" + ProvShipList[i].ProviderID.ToString() + ", " + ProvShipList[i].ShipmentID.ToString() + ")";
                insert.ExecuteNonQuery();
            }
        }
        private void OFD_FileOk(object sender, CancelEventArgs e)
        {
            string file = OFD.FileName;

            BackupClass.BackupClass Backup = InputList.InputList.Backup(file);

            Shipments          = Backup.Shipments;
            Clients            = Backup.Clients;
            Providers          = Backup.Providers;
            ProvidersShipments = Backup.ProviderShipment;
            PurchaseHistoryL   = Backup.PurchaseHistory;

            MessageBox.Show("Списки успешно перезаписаны");
        }
Example #4
0
        public static ProviderShipmentList ProviderShipment(SQLiteConnection DataFile)
        {
            ProviderShipmentList ProvShipList = new ProviderShipmentList();
            SQLiteCommand        input        = new SQLiteCommand(DataFile);

            input.CommandText = "select * from ProviderShipment";
            SQLiteDataReader sdr = input.ExecuteReader();

            while (sdr.Read())
            {
                ProvShipList.Add(Convert.ToInt32(sdr.GetValue(0)), Convert.ToInt32(sdr.GetValue(1)));
            }
            return(ProvShipList);
        }
        private void StartScreen_Load(object sender, EventArgs e)
        {
            if (!File.Exists("mySQLiteLab.sqlite"))
            {
                SQLiteConnection.CreateFile("mySQLiteLab.sqlite");
            }
            DataFile.Open();

            CreateTable.CreateAll(DataFile);

            Shipments          = InputList.InputList.Shipment(DataFile);
            Providers          = InputList.InputList.Provider(DataFile);
            Clients            = InputList.InputList.Client(DataFile);
            ProvidersShipments = InputList.InputList.ProviderShipment(DataFile);
            PurchaseHistoryL   = InputList.InputList.PurchaseHistory(DataFile);

            MaxShipmentID        = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "prod");
            MaxClientID          = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "cl");
            MaxProviderID        = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "prov");
            MaxPurchaseHistoryID = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "ph");
        }
Example #6
0
 public static void OutputIntoSQL(SQLiteConnection DataFile, ShipmentList ShipList, ClientList CList, ProviderList ProvList, ProviderShipmentList ProvShipList, PurchaseHistoryList PurHisList)
 {
     ShipmentsIntoSQL(DataFile, ShipList);
     ClientsIntoSQL(DataFile, CList);
     ProvidersIntoSQL(DataFile, ProvList);
     ProviderShipmentsIntoSQL(DataFile, ProvShipList);
     PurchaseHistoryIntoSQL(DataFile, PurHisList);
 }
Example #7
0
        public static void OutputIntoXML(string file, ShipmentList ShipList, ClientList ClList, ProviderList ProvList, ProviderShipmentList ProvShipList, PurchaseHistoryList PurHisList)
        {
            BackupClass.BackupClass BC      = new BackupClass.BackupClass(ClList, ProvList, ShipList, ProvShipList, PurHisList);
            StreamWriter            NewFile = new StreamWriter(file);
            XmlSerializer           XMLSer  = new XmlSerializer(typeof(BackupClass.BackupClass));

            XMLSer.Serialize(NewFile, BC);
            NewFile.Close();
        }