Example #1
0
        public void SummaryDataSearch()
        {
            ClearGridViewData(gridDetailData);

            ShowQueryResultToGridView(gridSummaryData, Mapper.GetGridViewSummaryCommand(this.Name), null);

            // If there`s no query result for selected year
            if (gridSummaryData.Rows.Count == 0)
            {
                ClearGridViewData(gridSummaryData);
                SetSelectionLabelText(new List <string> {
                    ""
                });

                MessageBox.Show($"{dateTimePicker.Value.ToString("yyyy-MM")} is not closed yet.");

                return;
            }

            // There should not be automatic row selection when data is populated onto GridView
            DataGridViewFormat.UndoAutomaticRowSelection(gridSummaryData);

            DataGridViewFormat.ChangeGridViewFormat(gridSummaryData);

            ShowUpTypeSelectionLabel();

            // Showing up detail data is only allowed after summary data is showed up
            IsDetailDataShowUpAllowed = true;
        }
Example #2
0
        public void SummaryDataSearch()
        {
            List <List <int> > closedMonths = new List <List <int> >();
            List <string>      commands     = new List <string>()
            {
                DB_Configuration.FUNC_GET_CLOSED_MONTHS_tqtInOut,
                DB_Configuration.FUNC_GET_CLOSED_MONTHS_tqtInOutCKD,
                DB_Configuration.FUNC_GET_CLOSED_MONTHS_tmtInOutProd,
                DB_Configuration.FUNC_GET_CLOSED_MONTHS_tmtInOutSemi
            };

            using (SqlConnection sqlConnection = new SqlConnection(DB_Configuration.ConnectionString))
            {
                foreach (string command in commands)
                {
                    using (SqlCommand sqlCommand = new SqlCommand(command, sqlConnection))
                    {
                        sqlConnection.Open();
                        using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand))
                        {
                            DataTable dataTable = new DataTable();
                            sqlDataAdapter.Fill(dataTable);

                            closedMonths.Add(ConvertToList(dataTable));
                        }
                        sqlConnection.Close();
                    }
                }
                gridClosedMonths.DataSource = GetCommonValue(closedMonths);
            }

            DataGridViewFormat.ChangeGridViewFormat(gridClosedMonths);
            DataGridViewFormat.UndoAutomaticRowSelection(gridClosedMonths);
        }
Example #3
0
        public void TotalInventoryStatus_Load(object sender, EventArgs e)
        {
            labelDatePicker.Text = "Reference Month";

            dateTimePicker.Format       = DateTimePickerFormat.Custom;
            dateTimePicker.CustomFormat = "yyyy.MM";
            dateTimePicker.Size         = new Size(120, 20);

            DataGridViewFormat.LimitUserInteractionWithDataGridView(gridSummaryData);
            gridSummaryData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader;

            DataGridViewFormat.LimitUserInteractionWithDataGridView(gridDetailData);
            gridDetailData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

            labelSelectedTypes.Visible     = false;
            labelSelectedTypes.Location    = new Point(labelTotalDetail.Right + 5, labelTotalDetail.Top);
            labelSelectedTypes.BorderStyle = BorderStyle.Fixed3D;

            // To make Rowheader include upto 4 digits ( Temporary resolution )
            gridDetailData.RowHeadersDefaultCellStyle.Padding = new Padding(4);
        }
Example #4
0
 private void ClosedInventoryStatusForm_Load(object sender, System.EventArgs e)
 {
     DataGridViewFormat.LimitUserInteractionWithDataGridView(gridClosedMonths);
 }