示例#1
0
 public LoginForm()
 {
     InitializeComponent();
     conn = Authorization.login(AppSettings.Nick, AppSettings.Password);
     SQL = new MySQLDriver(conn);
     Auth = new Authorization(SQL);
     AppSettings.lForm = this;
     ShowInTaskbar = true;
 }
示例#2
0
        public CompanyForm()
        {
            InitializeComponent();

            connector = Authorization.login(AppSettings.Nick, AppSettings.Password);
            SQL = new MySQLDriver(connector);

            Auth = new Authorization(SQL);
            refreshData();
        }
示例#3
0
        public DeadlineForm()
        {
            InitializeComponent();

            errorProvider = new ErrorProvider();
            connector = Authorization.login(AppSettings.Nick, AppSettings.Password);
            SQL = new MySQLDriver(connector);
            Auth = new Authorization(SQL);

            refreshData();
        }
示例#4
0
        public InventoryForm()
        {
            InitializeComponent();
            connector = Authorization.login(AppSettings.Nick, AppSettings.Password);
            SQL = new MySQLDriver(connector);
            Inventory = new Inventory(SQL);
            Corrections = new Corrections(SQL);
            Deadlines = new Deadlines(SQL);
            Auth = new Authorization(SQL);

            dateTimePicker1.Value = DateTime.Now;

            resizeByDataGrid(dataGridView1);
        }
示例#5
0
        public SettingsForm()
        {
            InitializeComponent();

            Conn = Authorization.login(AppSettings.Nick, AppSettings.Password);
            SQL = new MySQLDriver(Conn);
            Auth = new Authorization(SQL);
            Groups = new Groups(SQL);
            Permissions = new Permissions(SQL);
            FormNames = new FormNames(SQL);
            ActionNames = new ActionNames(SQL);
            Users = new Users(SQL);

            refreshTab("tabPage1");
            refreshTab("tabPage2");
            refreshTab("tabPage3");
        }
示例#6
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();
        }
示例#7
0
        private void HandleSecurity()
        {
            exIfConnector conn = Authorization.login(AppSettings.Nick, AppSettings.Password);
            MySQLDriver driver = new MySQLDriver(conn);
            Authorization Auth = new Authorization(driver);

            if (!Auth.HasAccess(AppSettings.User, this.Name, "Edit_DataGridView"))
                dataGridView1.Enabled = false;
            if (!Auth.HasAccess(AppSettings.User, this.Name, "Open_CompanyForm"))
                button1.Enabled = false;
            if (!Auth.HasAccess(AppSettings.User, this.Name, "Open_UnitForm"))
                button2.Enabled = false;
            if (!Auth.HasAccess(AppSettings.User, this.Name, "Open_MaterialTypeForm"))
                button5.Enabled = false;
            if (!Auth.HasAccess(AppSettings.User, this.Name, "ExportPDF"))
                button6.Enabled = false;
            if (!Auth.HasAccess(AppSettings.User, this.Name, "Open_ShippingForm"))
                button7.Enabled = false;
        }
示例#8
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);
            ProductExports = new ProductExports(SQL);
            Auth = new Authorization(SQL);

            Status = "Inicializace...";

            if (firstRun)
            {
                monthComboBox.Items.Clear();
                monthComboBox.Items.AddRange(((new Months()).getList()).ToArray());
                monthComboBox.Text = (new Months()).getMonth(DateTime.Now.Month).ToString();

                Deadline deadline = (new Deadlines(SQL)).GetLast();
                yearUpDown.Value = (deadline.EventDate.Month == 12) ? deadline.EventDate.Year + 1 : deadline.EventDate.Year;
            }

            initState = true;
            if (!connector.IsConnected())
            {
                handleError();
                return;
            }
            reload();
            refresh();
        }