void PopulateItemGrid()
        {
            DataTable dataTable = new Repository.BaseDao().PopulateDataSourceData(Repository.Queries.ITEM_SELECT_QUERY);

            itemGridView.DataSource = dataTable;
            itemGridView.Columns["itemId"].Visible = false;
        }
        void PopulateUnitGrid()
        {
            DataTable dataTable = new Repository.BaseDao().PopulateDataSourceData(Repository.Queries.UNIT_SELECT_QUERY);

            unitGridView.DataSource = dataTable;
            unitGridView.Columns["unitId"].Visible = false;
        }
        void PopulateUserGrid()
        {
            DataTable dataTable = new Repository.BaseDao().PopulateDataSourceData(Repository.Queries.USER_SELECT_QUERY);

            userGridView.DataSource = dataTable;
            userGridView.Columns["password"].Visible = false;
        }
 void DelayTextBoxTyping()
 {
     IDisposable subscription =
         Observable
         .FromEventPattern(
             h => txtUsername.TextChanged += h,
             h => txtUsername.TextChanged -= h)
         .Select(x => txtUsername.Text)
         .Throttle(TimeSpan.FromMilliseconds(700))
         .Select(x => Observable.Start(() => x.ToLower()))
         .Switch()
         .ObserveOn(this)
         .Subscribe(x =>
     {
         if (Regex.IsMatch(x, @"\s"))
         {
             MessageBox.Show("Dont use space in username");
             btnAdd.Enabled = false;
             return;
         }
         if (!String.IsNullOrWhiteSpace(x))
         {
             bool isExits = new Repository.BaseDao().IsRecordExits("user_auth", "username", x);
             if (isExits)
             {
                 btnAdd.Enabled = false;
                 MessageBox.Show("Username already exists! , Please use another username");
             }
             else
             {
                 btnAdd.Enabled = true;
             }
         }
     });
 }
        void PopulateCustomerGrid()
        {
            DataTable dataTable = new Repository.BaseDao().PopulateDataSourceData(Repository.Queries.CUSTOMER_SELECT_QUERY);

            customerGridView.DataSource = dataTable;
            customerGridView.Columns["customerId"].Visible = false;
        }
Ejemplo n.º 6
0
        void LoadCustomers()
        {
            DataTable dataTable = new Repository.BaseDao().PopulateDataSourceData(Repository.Queries.CUSTOMER_SELECT_QUERY);

            this.customerCombo.DataSource    = dataTable;
            this.customerCombo.DisplayMember = "name";
            this.customerCombo.ValueMember   = "customerId";
        }
Ejemplo n.º 7
0
        void LoadItems()
        {
            DataTable dataTable = new Repository.BaseDao().PopulateDataSourceData(Repository.Queries.ITEM_SELECT_QUERY);

            this.itemCombo.DataSource    = dataTable;
            this.itemCombo.DisplayMember = "Name";
            this.itemCombo.ValueMember   = "itemId";
        }
        bool CheckIfUserExits(Model.User user)
        {
            bool isAvailable = new Repository.BaseDao().IsRecordExits("user_auth", "username", txtUsername.Text.Trim());

            if (isAvailable)
            {
                MessageBox.Show("Username already exists! , Please use another username");
                txtUsername.Focus();
                txtUsername.Text = "";
            }

            return(isAvailable);
        }
Ejemplo n.º 9
0
        void PopulateOrderGrid()
        {
            DataTable dataTable = new Repository.BaseDao().PopulateDataSourceData(Repository.Queries.ORDER_SELECT_QUERY);

            dataTable.DefaultView.Sort = "creation_date desc";
            orderGridView.DataSource   = dataTable;
            orderGridView.Columns["date"].DefaultCellStyle.Format = "dd-MMM-yyyy";
            orderGridView.Columns["orderId"].Visible       = false;
            orderGridView.Columns["customerId"].Visible    = false;
            orderGridView.Columns["itemId"].Visible        = false;
            orderGridView.Columns["creation_date"].Visible = false;
            orderGridView.Columns["last_modified"].Visible = false;

            LoadStats();
        }