Example #1
0
        public static bool checkVersion(Modules Module, string version)
        {
            bool ret = false;
            try
            {
                Settings sett = new Settings();
                ftpClient ftp = new ftpClient(sett.FTP_Server, sett.FTP_User, sett.FTP_Password);
                foreach(String file in ftp.GetFileList(sett.FTP_Path))
                {
                    if(file == "info.version")
                    {
                        ftp.Download(Environment.GetEnvironmentVariable("TEMP"), "info.version", sett.FTP_Path, "info.version");
                        ini ver = new ini(Environment.GetEnvironmentVariable("TEMP") + "\\info.version");
                        switch(Module)
                        {
                            case Modules.Acceptance:
                                {
                                    if (ver.IniReadValue("version", "Acceptance", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            case Modules.Administrator:
                                {
                                    if (ver.IniReadValue("version", "Administrator", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            case Modules.Designer:
                                {
                                    if (ver.IniReadValue("version", "Designer", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            case Modules.Operator:
                                {
                                    if (ver.IniReadValue("version", "Operator", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            case Modules.Robot:
                                {
                                    if (ver.IniReadValue("version", "Robot", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            case Modules.Inventory:
                                {
                                    if (ver.IniReadValue("version", "Inventory", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            case Modules.Kiosk:
                                {
                                    if (ver.IniReadValue("version", "Kiosk", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            case Modules.Exchanger:
                                {
                                    if (ver.IniReadValue("version", "Exchanger", "0").Trim() != version)
                                        ret = false;
                                    else
                                        ret = true;
                                    break;
                                }
                            default:
                                {
                                    ret = false;
                                    break;
                                }
                        }
                    }
                }
                //ret = true;
            }
            catch (Exception ex)
            {
                ret = true;
            }
            finally
            {

            }
            return ret;
        }
Example #2
0
        public Settings()
        {
            string iniFile = Semaphore.semRemoteSettings + "\\settings.ini";
            if(iniFile == "\\settings.ini")
            {
                iniFile = System.Environment.GetCommandLineArgs()[0].Substring(
                0,
                System.Environment.GetCommandLineArgs()[0].LastIndexOf('\\')
                ) + "\\settings.ini";
                if (!File.Exists(System.Environment.GetCommandLineArgs()[0].Substring(
                0,
                System.Environment.GetCommandLineArgs()[0].LastIndexOf('\\')
                ) + "\\settings.ini"))
                    File.Create(System.Environment.GetCommandLineArgs()[0].Substring(
                0,
                System.Environment.GetCommandLineArgs()[0].LastIndexOf('\\')
                ) + "\\settings.ini");
            }

            f = new ini(iniFile);

            _Connection_type = f.IniReadValue("DB", "Connection_type", "ConnectionString"); //string
            _Db_dsn = f.IniReadValue("DB", "Db_dsn", ""); //string
            _Db_server = f.IniReadValue("DB", "Db_server", "svr\\sqlexpress"); //string
            _Db_user = f.IniReadValue("DB", "Db_user", "sa"); //string
            _Db_password = f.IniReadValue("DB", "Db_password", "solaris"); //string
            _Db_base = f.IniReadValue("DB", "Db_base", "PSAv1"); //string
            _Connection_string = f.IniReadValue("DB", "Connection_string", ""); //string
            _Block_inventory = bool.Parse(f.IniReadValue("Inventory", "Block_inventory", "true")); //bool
            _Run_one_copy_acceptance = bool.Parse(f.IniReadValue("Run", "Run_one_copy_acceptance", "true")); //bool
            _Run_one_copy_inventory = bool.Parse(f.IniReadValue("Run", "Run_one_copy_inventory", "true")); //bool
            _Run_one_copy_oprator = bool.Parse(f.IniReadValue("Run", "Run_one_copy_oprator", "true")); //bool
            _Run_one_copy_designer = bool.Parse(f.IniReadValue("Run", "Run_one_copy_designer", "true")); //bool
            _Run_one_copy_admin = bool.Parse(f.IniReadValue("Run", "Run_one_copy_admin", "true")); //bool
            _Run_one_copy_robot = bool.Parse(f.IniReadValue("Run", "Run_one_copy_robot", "true")); //bool
            _Dir_print = f.IniReadValue("Main", "Dir_print", ""); //string
            _Dir_edit = f.IniReadValue("Main", "Dir_edit", ""); //string
            _Dir_tmp_export = f.IniReadValue("Main", "Dir_tmp_export", ""); //string
            _Search_SubDir = bool.Parse(f.IniReadValue("Main", "Search_SubDir", "true")); //bool
            _List_of_files = f.IniReadValue("Main", "List_of_files", "jpg, jpeg, bmp, gif, tif"); //string
            _Dir_rescan = int.Parse(f.IniReadValue("Main", "Dir_rescan", "5")); //int
            _Time_for_output = int.Parse(f.IniReadValue("Main", "Time_for_output", "1")); //int
            _Time_begin_work = int.Parse(f.IniReadValue("Main", "Time_begin_work", "8")); //int
            _Time_end_work = int.Parse(f.IniReadValue("Main", "Time_end_work", "22")); //int
            _Order_terminal_prefics = f.IniReadValue("Main", "Order_terminal_prefics", "40"); //string
            _Order_prefics = f.IniReadValue("Main", "Order_prefics", "00"); //string
            _Qbtn01_id = f.IniReadValue("Form", "Qbtn01_id", ""); //string
            _Qbtn01_text = f.IniReadValue("Form", "Qbtn01_text", ""); //string
            _Qbtn02_id = f.IniReadValue("Form", "Qbtn02_id", ""); //string
            _Qbtn02_text = f.IniReadValue("Form", "Qbtn02_text", ""); //string
            _Qbtn03_id = f.IniReadValue("Form", "Qbtn03_id", ""); //string
            _Qbtn03_text = f.IniReadValue("Form", "Qbtn03_text", ""); //string
            _Qbtn04_id = f.IniReadValue("Form", "Qbtn04_id", ""); //string
            _Qbtn04_text = f.IniReadValue("Form", "Qbtn04_text", ""); //string
            _Qbtn05_id = f.IniReadValue("Form", "Qbtn05_id", ""); //string
            _Qbtn05_text = f.IniReadValue("Form", "Qbtn05_text", ""); //string
            _Qbtn06_id = f.IniReadValue("Form", "Qbtn06_id", ""); //string
            _Qbtn06_text = f.IniReadValue("Form", "Qbtn06_text", ""); //string
            _Qbtn07_id = f.IniReadValue("Form", "Qbtn07_id", ""); //string
            _Qbtn07_text = f.IniReadValue("Form", "Qbtn07_text", ""); //string
            _Qbtn08_id = f.IniReadValue("Form", "Qbtn08_id", ""); //string
            _Qbtn08_text = f.IniReadValue("Form", "Qbtn08_text", ""); //string
            _Qbtn09_id = f.IniReadValue("Form", "Qbtn09_id", ""); //string
            _Qbtn09_text = f.IniReadValue("Form", "Qbtn09_text", ""); //string
            _Qbtn10_id = f.IniReadValue("Form", "Qbtn10_id", ""); //string
            _Qbtn10_text = f.IniReadValue("Form", "Qbtn10_text", ""); //string
            _Qbtn01_stext = f.IniReadValue("Form", "Qbtn01_stext", ""); //string
            _Qbtn02_stext = f.IniReadValue("Form", "Qbtn02_stext", ""); //string
            _Qbtn03_stext = f.IniReadValue("Form", "Qbtn03_stext", ""); //string
            _Qbtn04_stext = f.IniReadValue("Form", "Qbtn04_stext", ""); //string
            _Qbtn05_stext = f.IniReadValue("Form", "Qbtn05_stext", ""); //string
            _Qbtn06_stext = f.IniReadValue("Form", "Qbtn06_stext", ""); //string
            _Qbtn07_stext = f.IniReadValue("Form", "Qbtn07_stext", ""); //string
            _Qbtn08_stext = f.IniReadValue("Form", "Qbtn08_stext", ""); //string
            _Qbtn09_stext = f.IniReadValue("Form", "Qbtn09_stext", ""); //string
            _Qbtn10_stext = f.IniReadValue("Form", "Qbtn10_stext", ""); //string
            _UpdatePaymentTable = int.Parse(f.IniReadValue("Main", "UpdatePaymentTable", "30")); //int
            _UpdateOrderTableInAcceptance = int.Parse(f.IniReadValue("Main", "UpdateOrderTableInAcceptance", "30")); //int
            _PathReportsTemplates = f.IniReadValue("Main", "PathReportsTemplates", ""); //string
            _Color_rows_in_order = bool.Parse(f.IniReadValue("Main", "Color_rows_in_order", "false")); //bool
            _Fly_window_operator = bool.Parse(f.IniReadValue("Main", "Fly_window_operator", "true")); //bool
            _Mod_operator_top_most = bool.Parse(f.IniReadValue("Main", "Mod_operator_top_most", "true")); //bool
            _UpdateOrderTableInOperator = int.Parse(f.IniReadValue("Main", "UpdateOrderTableInOperator", "60")); //int
            _Mod_designer_top_most = bool.Parse(f.IniReadValue("Main", "Mod_designer_top_most", "true")); //bool
            _UpdateOrderTableInDesigner = int.Parse(f.IniReadValue("Main", "UpdateOrderTableInDesigner", "60")); //int
            _Fly_window_designer = bool.Parse(f.IniReadValue("Main", "Fly_window_designer", "true")); //bool
            _Dir_import = f.IniReadValue("Main", "Dir_import", ""); //string
            _Dir_export = f.IniReadValue("Main", "Dir_export", ""); //string
            _Dir_net_export = f.IniReadValue("Main", "Dir_net_export", ""); //string
            _Robot_animation_icon = bool.Parse(f.IniReadValue("Robot", "Robot_animation_icon", "true")); //bool
            _SQL_Import_Template_Mashine = f.IniReadValue("Robot", "SQL_Import_Template_Mashine", ""); //string
            _SQL_Import_Template_DCard = f.IniReadValue("Robot", "SQL_Import_Template_DCard", ""); //string
            _SQL_Import_Template_Material = f.IniReadValue("Robot", "SQL_Import_Template_Material", ""); //string
            _SQL_Import_Template_Good = f.IniReadValue("Robot", "SQL_Import_Template_Good", ""); //string
            _ReklamBlock1 = f.IniReadValue("Main", "ReklamBlock1", "").Replace("<br>", "\n"); //string
            _CheckPreview = bool.Parse(f.IniReadValue("Main", "CheckPreview", "false")); //bool
            _CheckCount = int.Parse(f.IniReadValue("Main", "CheckCount", "2")); //int
            _PasswordClass1 = f.IniReadValue("Main", "PasswordClass1", ""); //string
            _SMTPServer = f.IniReadValue("Debug", "SMTPServer", "int.fotoland.ru"); //string
            _SMTPAut = bool.Parse(f.IniReadValue("Debug", "SMTPAut", "true")); //bool
            _SMTPUserFrom = f.IniReadValue("Debug", "SMTPUserFrom", "PSA Error reporter"); //string
            _SMTPUserFromEmail = f.IniReadValue("Debug", "SMTPUserFromEmail", "*****@*****.**"); //string
            _SMTPPasswordFrom = f.IniReadValue("Debug", "SMTPPasswordFrom", "psa1029"); //string
            _SMTPUserTo = f.IniReadValue("Debug", "SMTPUserTo", "*****@*****.**"); //string
            _AutoSendCrashReport = bool.Parse(f.IniReadValue("Debug", "AutoSendCrashReport", "false")); //bool
            _FTP_Server = f.IniReadValue("Robot", "FTP_Server", "int.fotoland.ru"); //string
            _FTP_Server_Export = f.IniReadValue("Robot", "FTP_Server_Export", "int.fotoland.ru"); //string
            _FTP_User = f.IniReadValue("Robot", "FTP_User", "anonynous"); //string
            _FTP_Password = f.IniReadValue("Robot", "FTP_Password", "*****@*****.**"); //string
            _FTP_Path = f.IniReadValue("Robot", "FTP_Path", "PSA/XXXXX/Import"); //string
            _FTP_Path_Export = f.IniReadValue("Robot", "FTP_Path_Export", "PSA/XXXXX/Export"); //string
            _Export_from_ftp = bool.Parse(f.IniReadValue("Robot", "Export_from_ftp", "true")); //bool
            _Import_from_ftp = bool.Parse(f.IniReadValue("Robot", "Import_from_ftp", "true")); //bool
            _Import_time = int.Parse(f.IniReadValue("Robot", "Import_time", "60")); //int
            _Export_time = int.Parse(f.IniReadValue("Robot", "Export_time", "60")); //int
            _ShortGoodsListInWizard = bool.Parse(f.IniReadValue("Main", "ShortGoodsListInWizard", "true")); //bool
            _ExportDoCopy = bool.Parse(f.IniReadValue("Robot", "ExportDoCopy", "true")); //bool
            _ExportClearDirAfterCopy = bool.Parse(f.IniReadValue("Robot", "ExportClearDirAfterCopy", "true")); //bool
            _ModelRound = int.Parse(f.IniReadValue("Main", "ModelRound", "5")); //int
            _QueryForDelete = bool.Parse(f.IniReadValue("Debug", "QueryForDelete", "true")); //bool
            _DenyDelete = bool.Parse(f.IniReadValue("Debug", "DenyDelete", "true")); //bool
            _DCard_limit = int.Parse(f.IniReadValue("Main", "DCard_limit", "2")); //int
            _PublicIni = f.IniReadValue("Main", "PublicIni", ""); //string
            _SemaphoreInventory = bool.Parse(f.IniReadValue("Semaphore", "SemaphoreInventory", "false")); //bool
            _Round3 = bool.Parse(f.IniReadValue("Main", "Round3", "false")); //bool
            _Terminal_client_one = bool.Parse(f.IniReadValue("Terminal", "TerminalClient", "false")); //bool
            _Terminal_print_check = bool.Parse(f.IniReadValue("Terminal", "TerminalPrintCheck", "true")); //bool
            _Terminal_control_worker = bool.Parse(f.IniReadValue("Terminal", "TerminalControlWorker", "true")); //bool
            _UseXmlCache = bool.Parse(f.IniReadValue("Terminal", "UseXmlCache", "false")); //bool
            _LoadNotApproved = bool.Parse(f.IniReadValue("Terminal", "LoadNotApproved", "false")); //bool
            _Load1000 = bool.Parse(f.IniReadValue("Terminal", "Load1000", "true")); //bool
            _ShowQuickOrder = bool.Parse(f.IniReadValue("Main", "ShowQuickOrder", "false")); //bool
            _ShowMFoto = bool.Parse(f.IniReadValue("Main", "ShowMFoto", "false")); //bool
            _DiscontServerAddress = f.IniReadValue("Main", "DiscontServerAddress", "k.fotoland.ru"); //staring
            _checkString1 = f.IniReadValue("Main", "checkString1", "").Replace("<br>", "\n"); //staring
            _checkString2 = f.IniReadValue("Main", "checkString2", "").Replace("<br>", "\n"); //staring
            _mfotoAlbumsPath = f.IniReadValue("Main", "MfotoAlbumsPath", "d:\\MPR500_Albums"); //staring

            _ExportOld = bool.Parse(f.IniReadValue("Main", "ExportOld", "true")); //bool
            _DontLockExported = bool.Parse(f.IniReadValue("Main", "DontLockExported", "true")); //bool
            _Dir_auto_import = f.IniReadValue("Main", "DirAutoImport", "d:\\Exchange"); //staring

            _PublicKey = f.IniReadValue("API", "PublicKey", "3c209e8c86464be69d9fbf36b1bde8a9"); //staring
            _PrivateKey = f.IniReadValue("API", "PrivateKey", "b41e9b4a20c647038bc590bac05ecf30"); //staring
            _ApiRequestToken = f.IniReadValue("API", "RequestToken", "http://api.pixlpark.com/oauth/requesttoken"); //staring
            _ApiAccessToken = f.IniReadValue("API", "AccessToken", "http://api.pixlpark.com/oauth/accesstoken"); //staring
            _ApiOrder = f.IniReadValue("API", "Order", "http://api.pixlpark.com/orders/"); //staring
            _ApiOrderItems = f.IniReadValue("API", "OrderItems", "http://api.pixlpark.com/orders/"); //staring
            _ApiProducts = f.IniReadValue("API", "Products", "http://api.pixlpark.com/products"); //staring
            _ApiUser = f.IniReadValue("API", "User", "http://api.pixlpark.com/users/"); //staring
            _OrderPixlPark = f.IniReadValue("API", "OrderPrefix", "50"); //staring
            _AStatus = f.IniReadValue("API", "A Status", "000000"); //staring
            _OStatus = f.IniReadValue("API", "O Status", "000100"); //staring
            _DStatus = f.IniReadValue("API", "D Status", "000200"); //staring
            _SelectImport = bool.Parse(f.IniReadValue("API", "Select import", "true")); //bool
            _PrintAfterImport = bool.Parse(f.IniReadValue("API", "Print after import", "true")); //bool
            _PixlParkClient = bool.Parse(f.IniReadValue("API", "PixlPark Client", "false")); //bool
            _EmailDayReport = f.IniReadValue("Main", "Email day report", "*****@*****.**"); //staring
            _EmailDayFrom = f.IniReadValue("Main", "Email day report from", "*****@*****.**"); //staring
            _EmailDayAuth = f.IniReadValue("Main", "Email day report auth", "psa"); //staring
            _EmailDayPas = f.IniReadValue("Main", "Email day report pas", "psa1029"); //staring
            _EmailDayHost = f.IniReadValue("Main", "Email day report host", "mail.fotoland.ru"); //staring
            _EmailDayPort = int.Parse(f.IniReadValue("Main", "Email day report port", "25")); //int
        }
Example #3
0
        private void LoadData()
        {
            btnUpdate.Enabled = false;
            tmr.Stop();
            try
            {
                DataTable tbl = new DataTable();
                tbl.Columns.Add("a");
                tbl.Columns.Add("d");

                ini iniRobot = new ini(prop.Dir_export + "\\robot.ini");
                DataRow r;

                r = tbl.NewRow();
                r["a"] = "Импорт спр. машин";
                r["d"] = iniRobot.IniReadValue("import", "mashine", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Импорт материалов";
                r["d"] = iniRobot.IniReadValue("import", "material", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Импорт услуг";
                r["d"] = iniRobot.IniReadValue("import", "good", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Импорт прайса";
                r["d"] = iniRobot.IniReadValue("import", "price", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Импорт категорий клиентов";
                r["d"] = iniRobot.IniReadValue("import", "category", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Импорт дисконтных карт";
                r["d"] = iniRobot.IniReadValue("import", "dcard", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Импорт типов оплаты";
                r["d"] = iniRobot.IniReadValue("import", "ptype", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт заказов";
                r["d"] = iniRobot.IniReadValue("export", "order", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт платежей";
                r["d"] = iniRobot.IniReadValue("export", "payment", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт инвентаризации";
                r["d"] = iniRobot.IniReadValue("export", "inventory", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт сверки";
                r["d"] = iniRobot.IniReadValue("export", "verification", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт по терминалам";
                r["d"] = iniRobot.IniReadValue("export", "taction", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт списаний";
                r["d"] = iniRobot.IniReadValue("export", "discard", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт счетчиков операторов";
                r["d"] = iniRobot.IniReadValue("export", "counter1", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт данных в офис";
                r["d"] = iniRobot.IniReadValue("export", "csv", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт ошибок в офис";
                r["d"] = iniRobot.IniReadValue("export", "er", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Экспорт логов чистки базы в офис";
                r["d"] = iniRobot.IniReadValue("export", "clear", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Обновление кеша терминальных заказов";
                r["d"] = iniRobot.IniReadValue("cache", "korder", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Обновление кеша интернет заказов";
                r["d"] = iniRobot.IniReadValue("cache", "irorder", "нет данных");
                tbl.Rows.Add(r);

                r = tbl.NewRow();
                r["a"] = "Обновление кеша оптовых заказов";
                r["d"] = iniRobot.IniReadValue("cache", "ioorder", "нет данных");
                tbl.Rows.Add(r);

                data.DataSource = tbl;
                data.Cols[1].Caption = "Действие";
                data.Cols[2].Caption = "Время";
                data.Cols[1].AllowEditing = false;
                data.Cols[2].AllowEditing = false;
                data.Cols[1].AllowSorting = true;
                data.Cols[2].AllowSorting = true;
                data.Cols[1].Width = 245;
                data.Cols[2].Width = 150;

                if (File.Exists(prop.Dir_net_export + "\\robot.export"))
                {
                    btnExport.Enabled = false;
                }
                else
                {
                    btnExport.Enabled = true;
                }

                if (File.Exists(prop.Dir_net_export + "\\robot.cache"))
                {
                    button1.Enabled = false;
                }
                else
                {
                    button1.Enabled = true;
                }

                if (File.Exists(prop.Dir_net_export + "\\robot.import"))
                {
                    btnImport.Enabled = false;
                }
                else
                {
                    btnImport.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n" + ex.Source);
            }
            btnUpdate.Enabled = true;
            tmr.Start();
        }