private void InitNewReceiptsDespatchs()
        {
            _documentLogic           = new DocumentLogic();
            documentTypeDictionary   = new Dictionary <int, string>();
            documentStatusDictionary = new Dictionary <int, string>();
            _clientLogic             = new ClientLogic();
            _warehouseLogic          = new WarehouseLogic();
            documentTypeDictionary.Add(2, "Svi");
            documentTypeDictionary.Add(0, "Prijemnica");
            documentTypeDictionary.Add(1, "Otpremnica");
            cmbDocumentType.DisplayMember = "Value";
            cmbDocumentType.ValueMember   = "Key";
            cmbDocumentType.DropDownStyle = ComboBoxStyle.DropDownList;
            cmbDocumentType.DataSource    = documentTypeDictionary.ToList();


            documentStatusDictionary = new Dictionary <int, string>
            {
                { 3, "Svi" },
                { 0, "Neplaćeni" },
                { 1, "Plaćeni" },
                { 2, "Storno" }
            };
            cmbDocumentStatus.DisplayMember = "Value";
            cmbDocumentStatus.ValueMember   = "Key";
            cmbDocumentStatus.DropDownStyle = ComboBoxStyle.DropDownList;
            dtCreatedDateFrom.Format        = DateTimePickerFormat.Custom;
            dtCreatedDateFrom.Value         = DateTime.Today.AddDays(-30);
            dtCreatedDateTo.Format          = DateTimePickerFormat.Custom;
            dtCreatedDateFrom.CustomFormat  = "MM/dd/yyyy";
            dtCreatedDateTo.CustomFormat    = "MM/dd/yyyy";
            cmbDocumentStatus.DataSource    = documentStatusDictionary.ToList();

            var statuses = new List <Status>()
            {
                new Status()
                {
                    ID = 0, Name = "Neplaćeni"
                }, new Status()
                {
                    ID = 1, Name = "Plaćeni"
                }, new Status()
                {
                    ID = 2, Name = "Storno"
                }
            };

            documentTypeBindingSource.DataSource = statuses.ToList();
            //  documentBindingSource.DataSource = _documentLogic.GetDocumentForLast30Days();
            clientBindingSource.DataSource    = _clientLogic.GetAllClients();
            warehouseBindingSource.DataSource = _warehouseLogic.GetAllWarehouse();

            DGVNewReceiptDespatch.DataError      += DGVNewReceiptDespatch_DataError;
            DGVNewReceiptDespatch.SelectionMode   = DataGridViewSelectionMode.FullRowSelect;
            DGVNewReceiptDespatch.DoubleClick    += SelectedRow_DoubleClick;
            DGVNewReceiptDespatch.CellFormatting += DGVNewReceiptDespatch_CellFormatting;
        }
Ejemplo n.º 2
0
 private void InitClients()
 {
     _clientLogic          = new ClientLogic();
     DGVClients.DataSource = _clientLogic.GetAllClients();
     if (!SelectionMode)
     {
         DGVClients.AllowUserToAddRows    = false;
         DGVClients.ReadOnly              = true;
         DGVClients.AllowUserToDeleteRows = false;
         DGVClients.SelectionMode         = DataGridViewSelectionMode.FullRowSelect;
         DGVClients.DoubleClick          += SelectedRow_DoubleClick;
     }
     else
     {
         DGVClients.AllowUserToAddRows    = false;
         DGVClients.ReadOnly              = true;
         DGVClients.AllowUserToDeleteRows = true;
         DGVClients.Click           += Right_Click;
         DGVClients.UserDeletingRow += DGVClients_UserDeletingRow;
         DGVClients.UserDeletedRow  += DGVClients_UserDeletedRow;
         DGVClients.MouseDown       += new System.Windows.Forms.MouseEventHandler(this.MyDataGridView_MouseDown);
         SelectedRow.Click          += new System.EventHandler(this.SelectedRow_Click);
     }
 }
Ejemplo n.º 3
0
 private void RefreshDGVSource()
 {
     DGVClients.DataSource = _clientLogic.GetAllClients();
     DGVClients.RefreshEdit();
 }