Пример #1
0
 public Compositions(MySQLDriver driver)
 {
     this._SQL = driver;
     _units = new Units(_SQL);
     _materialTypes = new MaterialTypes(_SQL);
     _products = new Products(_SQL);
 }
Пример #2
0
 public Inventory(MySQLDriver driver)
 {
     _SQL = driver;
     _deadlines = new Deadlines(_SQL);
     _materialTypes = new MaterialTypes(_SQL);
     _units = new Units(_SQL);
     _companies = new Companies(_SQL);
     _currencies = new Currencies(_SQL);
 }
Пример #3
0
 public Transfers(MySQLDriver driver)
 {
     this._SQL = driver;
     _deadlines = new Deadlines(_SQL);
     _units = new Units(_SQL);
     _companies = new Companies(_SQL);
     _materialTypes = new MaterialTypes(_SQL);
     _currencies = new Currencies(_SQL);
 }
Пример #4
0
 public Materials(MySQLDriver driver, Companies companies, Units units, Deadlines deadlines)
 {
     this._SQL = driver;
     _companies = companies;
     _units = units;
     _currencies = new Currencies(_SQL);
     _materialTypes = new MaterialTypes(_SQL);
     _deadlines = deadlines;
 }
Пример #5
0
        public override void init(bool firstRun = true)
        {
            Status = "Připojování k databázi...";
            connector = Authorization.login(AppSettings.Nick, AppSettings.Password);
            connector.onError = new Action(()=>connectorErrorHandler(connector));
            SQL = new MySQLDriver(connector);
            Units = new Units(SQL);
            Auth = new Authorization(SQL);
            MaterialTypes = new MaterialTypes(SQL);
            Compositions = new Compositions(SQL);
            Status = "Inicializace...";

            if (firstRun){}

            initState = true;
            if (!connector.IsConnected())
            {
                handleError();
                return;
            }
            reload();
            refresh();
        }
Пример #6
0
 public Corrections(MySQLDriver driver)
 {
     _SQL = driver;
     _materialTypes = new MaterialTypes(_SQL);
     _deadlines = new Deadlines(_SQL);
 }
Пример #7
0
        private DeadlineTransferRow parseTransferLine(String line)
        {
            MaterialTypes MaterialTypes = new MaterialTypes(_SQL);
            Units Units = new Units(_SQL);

            String IDMaterialString = MySQLDriver.parseCollumn(line, "ID_MATERIAL", true);
            String IDTransferString = MySQLDriver.parseCollumn(line, "ID_TRANSFER", true);
            String MaterialTypeString = MySQLDriver.parseCollumn(line, "ID_MATERIALTYPE", true);
            String AmountString = MySQLDriver.parseCollumn(line, "AMOUNT", true).Replace('.', ',');
            String UnitString = MySQLDriver.parseCollumn(line, "ID_UNIT", true);
            String PriceString = MySQLDriver.parseCollumn(line, "PRICE", true).Replace('.', ',');
            String CompanyString = MySQLDriver.parseCollumn(line, "ID_COMPANY", true);
            String CourseDateString = MySQLDriver.parseCollumn(line, "COURSEDATE");
            String CourseString = MySQLDriver.parseCollumn(line, "COURSE", true).Replace('.', ',');
            String CurrencyString = MySQLDriver.parseCollumn(line, "CURRENCY", true);

            Companies Companies = new Companies(_SQL);
            Currencies Currencies = new Currencies(_SQL);

            return new DeadlineTransferRow(
                int.Parse(IDMaterialString), int.Parse(IDTransferString), MaterialTypes.GetRecord(int.Parse(MaterialTypeString)),
                float.Parse(AmountString), Units.GetRecord(int.Parse(UnitString)), float.Parse(PriceString),
                Companies.GetRecord(int.Parse(CompanyString), true), DateTimeUtils.SQLDateToDateTime(CourseDateString),
                float.Parse(CourseString), Currencies.getCurrency(int.Parse(CurrencyString))
                );
        }