예제 #1
0
        public static void search(Int32 idHotel, Int32 idReserva, DataGridView dgvConsumiblesList)
        {
            SqlCommand command = new SqlCommand();

            command.CommandText = "PUNTO_ZIP.sp_consumibles_estadias_search";

            command.Parameters.Add(new SqlParameter("@p_id_hotel", SqlDbType.Int));
            command.Parameters["@p_id_hotel"].Value = idHotel;
            command.Parameters.Add(new SqlParameter("@p_id_reserva", SqlDbType.Int));
            command.Parameters["@p_id_reserva"].Value = idReserva;


            DataGridViewHelper.fill(command, dgvConsumiblesList);
        }
예제 #2
0
        public void Render(PerformanceData model)
        {
            if (InvokeRequired)
            {
                Invoke(new Action <PerformanceData>(Render), model);
                return;
            }

            dgvPerformanceEvents.DataSource = model.Items.OrderByDescending(n => n.StartTime).ToList();
            DataGridViewHelper.AutoSizeGrid(dgvPerformanceEvents);
            DataGridViewHelper.MakeSortable(dgvPerformanceEvents);

            StatusUpdate(StatusModel.Completed);
        }
예제 #3
0
 private void grdData_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     this.toolTip.Hide(this.grdData);
     if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
     {
         DataGridViewRow row = grdData.Rows[e.RowIndex];
         string          strCellToolTipText = DataGridViewHelper.GetDataRowInfo(grdData, row);
         this.toolTip.Show(strCellToolTipText, this.grdData);
     }
 }
 private void RenderTargetValues(NetworkMessageInfo msg)
 {
     try
     {
         dgvTargetProperties.SuspendLayout();
         dgvTargetProperties.DataSource = msg.Source.Values;
         DataGridViewHelper.AutoSizeGrid(dgvTargetProperties);
     }
     finally
     {
         dgvTargetProperties.ResumeLayout();
     }
     tsslTargetValueCount.Text = string.Format("Count {0}", msg.Source.Values.Count());
 }
예제 #5
0
 public InventoryForm(InventoryPresentationModel inventoryPresentationModelData, Model modelData)
 {
     InitializeComponent();
     _inventoryPresentationModel = inventoryPresentationModelData;
     _model = modelData;
     // Observers
     _model.ProductStorageQuantityChanged += UpdateProductStorageQuantityInStorageDataGridView;
     // UI
     _storageDataGridView.CellPainting     += (sender, eventArguments) => DataGridViewHelper.InitializeButtonImageOfButtonColumn(eventArguments, STORAGE_SUPPLY_BUTTON_COLUMN_INDEX, Resources.img_delivery_truck);
     _storageDataGridView.CellContentClick += ClickStorageDataGridViewCellContent;
     _storageDataGridView.SelectionChanged += (sender, eventArguments) => UpdateProductInfoView();
     // Initial UI States
     InitializeStorageDataGridView();
 }
예제 #6
0
        public List <TableColumnDesingerInfo> GetColumns()
        {
            List <TableColumnDesingerInfo> columnDesingerInfos = new List <TableColumnDesingerInfo>();

            int order = 1;

            foreach (DataGridViewRow row in this.dgvColumns.Rows)
            {
                TableColumnDesingerInfo col = new TableColumnDesingerInfo()
                {
                    Order = order
                };

                string colName = row.Cells[this.colColumnName.Name].Value?.ToString();

                if (!string.IsNullOrEmpty(colName))
                {
                    TableColumnDesingerInfo tag = row.Tag as TableColumnDesingerInfo;

                    string dataType = DataGridViewHelper.GetCellStringValue(row, this.colDataType.Name);

                    col.OldName           = tag?.OldName;
                    col.Name              = colName;
                    col.DataType          = dataType;
                    col.Length            = DataGridViewHelper.GetCellStringValue(row, this.colLength.Name);
                    col.IsNullable        = DataGridViewHelper.GetCellBoolValue(row, this.colNullable.Name);
                    col.IsPrimary         = DataGridViewHelper.GetCellBoolValue(row, this.colPrimary.Name);
                    col.IsIdentity        = DataGridViewHelper.GetCellBoolValue(row, this.colIdentity.Name);
                    col.DefaultValue      = DataGridViewHelper.GetCellStringValue(row, this.colDefaultValue.Name);
                    col.Comment           = DataGridViewHelper.GetCellStringValue(row, this.colComment.Name);
                    col.ExtraPropertyInfo = tag?.ExtraPropertyInfo;

                    UserDefinedType userDefinedType = this.GetUserDefinedType(dataType);

                    if (userDefinedType != null)
                    {
                        col.IsUserDefined = true;
                        col.TypeOwner     = userDefinedType.Owner;
                    }

                    row.Tag = col;

                    columnDesingerInfos.Add(col);

                    order++;
                }
            }

            return(columnDesingerInfos);
        }
예제 #7
0
        public MonitorScriptIDE()
        {
            InitializeComponent();

            UICommon.SetDoubleBuffered(this);
            DataGridViewHelper.AutoSizeGrid(dgvResults);

            CurrentViewState = ViewState.Summary; // Default
            dgvResults.Dock  = DockStyle.Fill;
            tvResults.Dock   = DockStyle.Fill;
            pnlSummary.Dock  = DockStyle.Fill;
            HandleDestroyed += MonitorScriptIDE_HandleDestroyed;
            ViewOptions();
        }
        private void ShowIndexExtraPropertites()
        {
            var row = DataGridViewHelper.GetSelectedRow(this.dgvIndexes);

            if (row != null)
            {
                string indexName = DataGridViewHelper.GetCellStringValue(row, this.colIndexName.Name);

                if (string.IsNullOrEmpty(indexName))
                {
                    return;
                }

                TableIndexDesignerInfo index = row.Tag as TableIndexDesignerInfo;

                if (index == null)
                {
                    index   = new TableIndexDesignerInfo();
                    row.Tag = index;
                }

                TableIndexExtraPropertyInfo extralProperty = index?.ExtraPropertyInfo;

                DataGridViewCell typeCell = row.Cells[this.colType.Name];

                if (extralProperty == null)
                {
                    extralProperty          = new TableIndexExtraPropertyInfo();
                    index.ExtraPropertyInfo = extralProperty;

                    if (DataGridViewHelper.GetCellStringValue(typeCell) != IndexType.Primary.ToString())
                    {
                        index.ExtraPropertyInfo.Clustered = false;
                    }
                }

                if (this.DatabaseType == DatabaseType.Oracle)
                {
                    this.indexPropertites.HiddenProperties = new string[] { nameof(extralProperty.Clustered) };
                }
                else
                {
                    this.indexPropertites.HiddenProperties = null;
                }

                this.indexPropertites.SelectedObject = extralProperty;
                this.indexPropertites.Refresh();
            }
        }
        private void dgvSettings_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            foreach (DataGridViewRow row in this.dgvSettings.Rows)
            {
                string dbType = DataGridViewHelper.GetCellStringValue(row, this.colDatabaseType.Name);

                if (dbType == DatabaseType.SqlServer.ToString())
                {
                    row.Cells[this.colClientToolFilePath.Name].ReadOnly = true;
                    row.Cells[this.colZipBackupFile.Name].ReadOnly      = true;
                }
            }

            this.dgvSettings.ClearSelection();
        }
예제 #10
0
        internal void SetFileInfo(FileInfo fileInfo)
        {
            Text = fileInfo.SourceFile.Filename;

            DataGridViewHelper.SetSourceGridFormats(GridFile);
            DataGridViewHelper.SetSourceGridFormats(GridDuplicateFileContent);
            DataGridViewHelper.SetFilesGridFormats(GridDuplicateFiles);
            GridFile.Columns[0].HeaderText = Path.GetFileName(fileInfo.SourceFile.Filename);

            _controller = new ViewController(new FileReaderFactoryImplementation());
            _controller.OnUpdateFileLines          += ControllerOnOnUpdateFileLines;
            _controller.OnUpdateDuplicateFiles     += Controller_OnUpdateDuplicateFiles;
            _controller.OnUpdateDuplicateFileLines += Controller_OnUpdateDuplicateFileLines;
            _controller.SetContext(fileInfo.SourceFile, fileInfo.LazyDuplicates);
        }
예제 #11
0
        public static void search(Int32 bookingId, DataGridView dgvRegisterStay)
        {
            SqlCommand command = new SqlCommand();

            command.CommandText = "PUNTO_ZIP.sp_estadia_booking_search";

            command.Parameters.AddWithValue("@p_stay_booking_id", bookingId);

            command.Parameters.AddWithValue("@p_stay_hotel_id", VarGlobal.usuario.hotel);

            command.Parameters.Add(new SqlParameter("@p_system_date", SqlDbType.DateTime));
            command.Parameters["@p_system_date"].Value = VarGlobal.FechaHoraSistema;

            DataGridViewHelper.fill(command, dgvRegisterStay);
        }
예제 #12
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            SaveFileDialog sf = new SaveFileDialog();

            sf.Filter           = "Excel Filles(*,xls)|*.xls";
            sf.CheckFileExists  = false;
            sf.CheckPathExists  = false;
            sf.FilterIndex      = 0;
            sf.RestoreDirectory = true;
            sf.CreatePrompt     = true;
            if (sf.ShowDialog() == DialogResult.OK)
            {
                Stream savestr = sf.OpenFile();
                DataGridViewHelper.DataGridViewToExcel(dgvBook, savestr);
            }
        }
        private void RenderSourceValues(NetworkMessageInfo msg)
        {
            try
            {
                dgvSourceProperties.ResumeLayout();
                dgvSourceProperties.DataSource = msg.Source.Values;
                scValues.SplitterDistance      = scValues.Width / 2;
                DataGridViewHelper.AutoSizeGrid(dgvSourceProperties);
            }
            finally
            {
                dgvSourceProperties.ResumeLayout();
            }

            tsslSourceValueCount.Text = string.Format("Count {0}", msg.Source.Values.Count());
        }
예제 #14
0
 private void buttonCheckOut_Click(object sender, EventArgs e)
 {
     if (dgvBooking.CurrentRow != null)
     {
         Int32 bookingId = Convert.ToInt32(dgvBooking.CurrentRow.Cells[0].Value);
         RegisterStayHelper.checkout(bookingId);
         MessageBox.Show("Se genero el checkout de la reserva correctamente", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         TextBoxHelper.clean(this);
         DataGridViewHelper.clean(dgvBooking);
         this.buttonCheckOut.Enabled = false;
     }
     else
     {
         MessageBox.Show("Debe seleccionar un reserva para generarle el checkout", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void dgvIndexes_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            this.dtTypeCellClick = DateTime.Now;

            if (e.RowIndex < 0)
            {
                return;
            }

            if (this.lbIndexType.Visible)
            {
                Rectangle?rectangle = this.GetCurrentCellRectangle();

                if (rectangle.HasValue && this.lbIndexType.Tag != null && (Rectangle)this.lbIndexType.Tag == rectangle.Value)
                {
                    this.lbIndexType.Visible = false;
                    return;
                }
            }

            this.lbIndexType.Visible = false;

            DataGridViewRow row       = this.dgvIndexes.Rows[e.RowIndex];
            bool            isPrimary = (row.Tag as TableIndexDesignerInfo)?.IsPrimary == true;

            if (e.ColumnIndex == this.colType.Index)
            {
                DataGridViewCell cell = row.Cells[this.colType.Name];

                if (isPrimary)
                {
                    return;
                }

                string value = DataGridViewHelper.GetCellStringValue(row, this.colType.Name);

                if (value != IndexType.Primary.ToString())
                {
                    if (!string.IsNullOrEmpty(value))
                    {
                        this.lbIndexType.SelectedItem = value;
                    }

                    this.SetListBoxPostition();
                }
            }
        }
예제 #16
0
        private List <BackupSetting> GetSettings()
        {
            List <BackupSetting> settings = new List <BackupSetting>();

            foreach (DataGridViewRow row in this.dgvSettings.Rows)
            {
                BackupSetting setting = new BackupSetting();
                setting.DatabaseType       = DataGridViewHelper.GetCellStringValue(row, this.colDatabaseType.Name);
                setting.ClientToolFilePath = DataGridViewHelper.GetCellStringValue(row, this.colClientToolFilePath.Name);
                setting.SaveFolder         = DataGridViewHelper.GetCellStringValue(row, this.colSaveFolder.Name);
                setting.ZipFile            = DataGridViewHelper.GetCellBoolValue(row, this.colZipBackupFile.Name);

                settings.Add(setting);
            }

            return(settings);
        }
        private async void ucPlaylistUpsert_Load(object sender, EventArgs e)
        {
            BuildAllTracksList();
            BuildPlaylistTracksList();

            var tracksRequest = new TrackSearchRequest()
            {
                Page         = _allTracksPage,
                ItemsPerPage = _itemsPerPage
            };

            await LoadListAllTracks(tracksRequest);

            if (_ID.HasValue)
            {
                _playlist = await _playlistApiService.GetById <Model.Playlist>(_ID.Value);

                txtName.Text      = _playlist.Name;
                txtCreatedAt.Text = _playlist.CreatedAt;
                txtOwner.Text     = _playlist.User.Username;

                if (_playlist.Image.Length != 0)
                {
                    pbPlaylistImage.Image    = ImageHelper.ByteArrayToSystemDrawing(_playlist.Image);
                    pbPlaylistImage.SizeMode = PictureBoxSizeMode.StretchImage;
                }

                _playlistTracks = await _playlistApiService.GetTracks <List <Model.Track> >(_ID.Value, null);

                var request = new TrackSearchRequest()
                {
                    Page         = _playlistTracksPage,
                    ItemsPerPage = _itemsPerPage
                };

                LoadListPlaylistTracks(request);
            }
            else
            {
                DataGridViewHelper.PopulateWithList(dgvPlaylistTracks, _playlistTracks, props);
            }


            SetButtonSavePosition();
        }
예제 #18
0
        private void dgvColumns_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                DataGridViewRow  row  = this.dgvColumns.Rows[e.RowIndex];
                DataGridViewCell cell = row.Cells[e.ColumnIndex];

                if (e.ColumnIndex == this.colColumnName.Index)
                {
                    string columnName = cell.Value?.ToString();

                    DataGridViewHelper.SetRowColumnsReadOnly(this.dgvColumns, row, string.IsNullOrEmpty(columnName), this.colColumnName);
                    this.SetColumnCellsReadonly(row);
                }
                else if (e.ColumnIndex == this.colDataType.Index)
                {
                    this.SetColumnCellsReadonly(row);
                }
                else if (e.ColumnIndex == this.colPrimary.Index)
                {
                    DataGridViewCell primaryCell  = row.Cells[this.colPrimary.Name];
                    DataGridViewCell nullableCell = row.Cells[this.colNullable.Name];

                    if (DataGridViewHelper.IsTrueValue(primaryCell.Value) && DataGridViewHelper.IsTrueValue(nullableCell.Value))
                    {
                        nullableCell.Value = false;
                    }
                }
                else if (e.ColumnIndex == this.colIdentity.Index)
                {
                    if (DataGridViewHelper.IsTrueValue(cell.Value))
                    {
                        foreach (DataGridViewRow r in this.dgvColumns.Rows)
                        {
                            if (r.Index >= 0 && r.Index != e.RowIndex)
                            {
                                r.Cells[this.colIdentity.Name].Value = false;
                            }
                        }
                    }

                    this.ShowColumnExtraPropertites();
                }
            }
        }
예제 #19
0
        public static void search(String rolName, DataGridView dvgRol)
        {
            SqlCommand command = new SqlCommand();

            command.CommandText = "PUNTO_ZIP.sp_rol_search";

            command.Parameters.Add(new SqlParameter("@p_rol_name", SqlDbType.VarChar, 255));
            if (rolName == string.Empty)
            {
                command.Parameters["@p_rol_name"].Value = null;
            }
            else
            {
                command.Parameters["@p_rol_name"].Value = rolName;
            }

            DataGridViewHelper.fill(command, dvgRol);
        }
예제 #20
0
        public FrmInvoice()
        {
            InitializeComponent();
            SetHeader("Invoice");

            invoiceRepository       = new InvoiceRepository();
            invoiceDetailRepository = new InvoiceDetailRepository();
            outletRepository        = new OutletRepository();
            productRepository       = new ProductRepository();

            productBindingSource.DataSource = productRepository.GetActiveProduct();
            outletBindingSource.DataSource  = outletRepository.GetActiveOutlet();

            DataGridViewHelper.SetDataGridTheme(dataGridView1);

            CekKondisi(FormCondition.Ready);
            isAddNew = false;
        }
예제 #21
0
        public static void search(String description, DataGridView dgvRegimen)
        {
            SqlCommand command = new SqlCommand();

            command.CommandText = "PUNTO_ZIP.sp_regimen_search";

            command.Parameters.Add(new SqlParameter("@p_regimen_description", SqlDbType.VarChar, 255));
            if (description == string.Empty)
            {
                command.Parameters["@p_regimen_description"].Value = null;
            }
            else
            {
                command.Parameters["@p_regimen_description"].Value = description;
            }

            DataGridViewHelper.fill(command, dgvRegimen);
        }
예제 #22
0
        public FrmLog()
        {
            InitializeComponent();

            log4netRepo = new Log4NetRepository();
            logData     = log4netRepo.GetAll();

            PageOffsetList offsetList = new PageOffsetList();

            offsetList.TotalRecords = logData.Count;
            totalRecords            = logData.Count;

            logsBindingNavigator.BindingSource = logsBindingSource;
            logsBindingSource.CurrentChanged  += new System.EventHandler(bindingSource1_CurrentChanged);
            logsBindingSource.DataSource       = offsetList;

            DataGridViewHelper.SetDataGridTheme(logsDataGridView);
        }
예제 #23
0
파일: FormPo.cs 프로젝트: 0000duck/MES-3
        private void btnImport_Click(object sender, EventArgs e)
        {
            var dt = DataGridViewHelper.ImportFileToDataTable();

            if (dt.Rows.Count == 0)
            {
                return;
            }

            try
            {
                GetDataList(dt);
                SetMasterDataSource(grid.PageSize);
            }
            catch (Exception ex)
            {
                MessageHelper.ShowInfo("Excel文件格式错误" + ex.Message);
            }
        }
예제 #24
0
        private void dgvForeignKeys_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            DataGridViewRow row = this.dgvForeignKeys.Rows[e.RowIndex];

            if (e.ColumnIndex == this.colReferenceTable.Index)
            {
                string referencedTableName = DataGridViewHelper.GetCellStringValue(row, this.colReferenceTable.Name);
                string keyName             = DataGridViewHelper.GetCellStringValue(row, this.colKeyName.Name);

                if (!string.IsNullOrEmpty(referencedTableName) && string.IsNullOrEmpty(keyName))
                {
                    row.Cells[this.colKeyName.Name].Value = IndexManager.GetForeignKeyDefaultName(this.Table.Name, referencedTableName);
                }
            }
        }
예제 #25
0
        private void dgvColumns_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                DataGridViewRow row = DataGridViewHelper.GetSelectedRow(this.dgvColumns);

                if (row != null)
                {
                    bool isEmptyNewRow = row.IsNewRow && DataGridViewHelper.IsEmptyRow(row);

                    this.tsmiDeleteColumn.Enabled = !isEmptyNewRow;
                }
                else
                {
                    this.tsmiDeleteColumn.Enabled = false;
                }

                this.contextMenuStrip1.Show(this.dgvColumns, e.Location);
            }
        }
예제 #26
0
        private void SetPathDataGridViewColumns()
        {
            DataGridViewHelper.SetColumns <PathParameter>(dataGridView1,
                                                          new List <string>
            {
                nameof(PathParameter.ProbabilityValue),
            });

            var actionColumn = new DataGridViewPathShowButtonColumn
            {
                DataPropertyName = nameof(PathParameter.Index),
                HeaderText       = "操作",
                Name             = "ColAction",
                ReadOnly         = true,
                Resizable        = DataGridViewTriState.False,
                Width            = 100
            };

            dataGridView1.Columns.Add(actionColumn);
        }
예제 #27
0
        private void SetIncomeDataGridViewColumns()
        {
            DataGridViewHelper.SetColumns <Template>(dgvIncome,
                                                     new List <string>
            {
                nameof(Template.FileName)
            });

            var actionColumn = new DataGridViewActionButtonColumn
            {
                DataPropertyName = "FullName",
                HeaderText       = "操作",
                Name             = "ColAction",
                ReadOnly         = true,
                Resizable        = DataGridViewTriState.False,
                Width            = 160
            };

            dgvIncome.Columns.Add(actionColumn);
        }
예제 #28
0
        /// <summary>
        /// Passing data for edit
        /// </summary>
        /// <param name="data"></param>
        public FrmInvoice(object data)
        {
            InitializeComponent();
            SetHeader("Invoice");

            invoiceRepository       = new InvoiceRepository(Program.log);
            invoiceDetailRepository = new InvoiceDetailRepository(Program.log);
            outletRepository        = new OutletRepository(Program.log);
            productRepository       = new ProductRepository(Program.log);

            productBindingSource.DataSource = productRepository.GetActiveProduct();
            outletBindingSource.DataSource  = outletRepository.GetActiveOutlet();

            DataGridViewHelper.SetDataGridTheme(dataGridView1);

            CekKondisi(FormCondition.Inputting);
            invoiceBindingSource.Add(data);

            isAddNew = false;
            countBtn.PerformClick();
        }
예제 #29
0
 private void SetList(DataTable source, Int32 listType)
 {
     dataGridViewList.DataSource = null;
     dataGridViewList.Columns.Clear();
     if (listType == 1)
     {
         DataGridViewHelper.SetDataGridViewHead(dataGridViewList, DataViewGridColumnsConfig.SNDetailReportSettings);
     }
     else if (listType == 2)
     {
         DataGridViewHelper.SetDataGridViewHead(dataGridViewList, DataViewGridColumnsConfig.SNSummaryReport_NOSNSettings);
     }
     else if (listType == 3)
     {
         DataGridViewHelper.SetDataGridViewHead(dataGridViewList, DataViewGridColumnsConfig.SNSummaryReport_SNSettings);
     }
     if (source != null)
     {
         dataGridViewList.DataSource = source;
     }
 }
        private async Task LoadList(PlaylistSearchRequest request)
        {
            var list = await _apiService.Get <List <Model.Playlist> >(request);

            if (list.Count > 0)
            {
                dgvPlaylists.ColumnCount = 0;
                DataGridViewHelper.PopulateWithList(dgvPlaylists, list, _props);

                _page = request.Page;
            }
            else if (!string.IsNullOrEmpty(Convert.ToString(txtSearch.Text)) && request.Page == 1)
            {
                dgvPlaylists.ColumnCount = 0;
                DataGridViewHelper.PopulateWithList(dgvPlaylists, list, _props);

                _page = 1;
            }

            btnPageNumber.Text = Convert.ToString(_page);
        }