Изменения, чтобы записи на форме выводились сразу.

This commit is contained in:
Anastasia 2023-03-20 11:00:13 +04:00
parent c24396e2b0
commit d8e282bec0
5 changed files with 34 additions and 27 deletions

View File

@ -106,6 +106,7 @@
this.Controls.Add(this.dataGridView);
this.Name = "FormComponents";
this.Text = "Компоненты";
this.Load += new System.EventHandler(this.FormComponents_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);

View File

@ -207,6 +207,7 @@
this.Controls.Add(this.groupBox);
this.Name = "FormJewel";
this.Text = "Изделие";
this.Load += new System.EventHandler(this.FormJewel_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.groupBox.ResumeLayout(false);
this.ResumeLayout(false);

View File

@ -100,6 +100,7 @@
this.Controls.Add(this.dataGridView);
this.Name = "FormJewels";
this.Text = "Изделия";
this.Load += new System.EventHandler(this.FormJewels_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);

View File

@ -32,12 +32,12 @@
this.СправочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.КомпонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ИзделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.buttonCreateOrder = new System.Windows.Forms.Button();
this.buttonTakeOrderInWork = new System.Windows.Forms.Button();
this.buttonOrderReady = new System.Windows.Forms.Button();
this.buttonIssuedOrder = new System.Windows.Forms.Button();
this.buttonRefresh = new System.Windows.Forms.Button();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.menuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
@ -49,7 +49,7 @@
this.СправочникиToolStripMenuItem});
this.menuStrip.Location = new System.Drawing.Point(0, 0);
this.menuStrip.Name = "menuStrip";
this.menuStrip.Size = new System.Drawing.Size(1121, 33);
this.menuStrip.Size = new System.Drawing.Size(1260, 33);
this.menuStrip.TabIndex = 0;
this.menuStrip.Text = "menuStrip1";
//
@ -76,24 +76,10 @@
this.ИзделияToolStripMenuItem.Text = "Изделия";
this.ИзделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click);
//
// dataGridView
//
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Location = new System.Drawing.Point(12, 36);
this.dataGridView.Name = "dataGridView";
this.dataGridView.RowHeadersWidth = 62;
this.dataGridView.RowTemplate.Height = 33;
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView.Size = new System.Drawing.Size(851, 402);
this.dataGridView.TabIndex = 1;
//
// buttonCreateOrder
//
this.buttonCreateOrder.Location = new System.Drawing.Point(884, 78);
this.buttonCreateOrder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCreateOrder.Location = new System.Drawing.Point(1038, 73);
this.buttonCreateOrder.Name = "buttonCreateOrder";
this.buttonCreateOrder.Size = new System.Drawing.Size(210, 34);
this.buttonCreateOrder.TabIndex = 2;
@ -103,7 +89,8 @@
//
// buttonTakeOrderInWork
//
this.buttonTakeOrderInWork.Location = new System.Drawing.Point(884, 150);
this.buttonTakeOrderInWork.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonTakeOrderInWork.Location = new System.Drawing.Point(1038, 145);
this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
this.buttonTakeOrderInWork.Size = new System.Drawing.Size(210, 34);
this.buttonTakeOrderInWork.TabIndex = 3;
@ -113,7 +100,8 @@
//
// buttonOrderReady
//
this.buttonOrderReady.Location = new System.Drawing.Point(884, 221);
this.buttonOrderReady.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOrderReady.Location = new System.Drawing.Point(1038, 216);
this.buttonOrderReady.Name = "buttonOrderReady";
this.buttonOrderReady.Size = new System.Drawing.Size(210, 34);
this.buttonOrderReady.TabIndex = 4;
@ -123,7 +111,8 @@
//
// buttonIssuedOrder
//
this.buttonIssuedOrder.Location = new System.Drawing.Point(884, 292);
this.buttonIssuedOrder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonIssuedOrder.Location = new System.Drawing.Point(1038, 287);
this.buttonIssuedOrder.Name = "buttonIssuedOrder";
this.buttonIssuedOrder.Size = new System.Drawing.Size(210, 34);
this.buttonIssuedOrder.TabIndex = 5;
@ -133,7 +122,8 @@
//
// buttonRefresh
//
this.buttonRefresh.Location = new System.Drawing.Point(884, 361);
this.buttonRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonRefresh.Location = new System.Drawing.Point(1038, 356);
this.buttonRefresh.Name = "buttonRefresh";
this.buttonRefresh.Size = new System.Drawing.Size(210, 34);
this.buttonRefresh.TabIndex = 6;
@ -141,21 +131,34 @@
this.buttonRefresh.UseVisualStyleBackColor = true;
this.buttonRefresh.Click += new System.EventHandler(this.ButtonRefresh_Click);
//
// dataGridView
//
this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Location = new System.Drawing.Point(12, 36);
this.dataGridView.Name = "dataGridView";
this.dataGridView.RowHeadersWidth = 62;
this.dataGridView.RowTemplate.Height = 33;
this.dataGridView.Size = new System.Drawing.Size(1003, 402);
this.dataGridView.TabIndex = 7;
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1121, 450);
this.ClientSize = new System.Drawing.Size(1260, 450);
this.Controls.Add(this.dataGridView);
this.Controls.Add(this.buttonRefresh);
this.Controls.Add(this.buttonIssuedOrder);
this.Controls.Add(this.buttonOrderReady);
this.Controls.Add(this.buttonTakeOrderInWork);
this.Controls.Add(this.buttonCreateOrder);
this.Controls.Add(this.dataGridView);
this.Controls.Add(this.menuStrip);
this.MainMenuStrip = this.menuStrip;
this.Name = "FormMain";
this.Text = "Ювелирная лавка";
this.Load += new System.EventHandler(this.FormMain_Load);
this.menuStrip.ResumeLayout(false);
this.menuStrip.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
@ -170,11 +173,11 @@
private ToolStripMenuItem СправочникиToolStripMenuItem;
private ToolStripMenuItem КомпонентыToolStripMenuItem;
private ToolStripMenuItem ИзделияToolStripMenuItem;
private DataGridView dataGridView;
private Button buttonCreateOrder;
private Button buttonTakeOrderInWork;
private Button buttonOrderReady;
private Button buttonIssuedOrder;
private Button buttonRefresh;
private DataGridView dataGridView;
}
}

View File

@ -25,6 +25,7 @@ namespace JewelryStore
private void LoadData()
{
_logger.LogInformation("Загрузка заказов");
try
{
var list = _orderLogic.ReadList(null);
@ -32,12 +33,12 @@ namespace JewelryStore
{
dataGridView.DataSource = list;
dataGridView.Columns["JewelId"].Visible = false;
dataGridView.Columns["JewelName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
}
_logger.LogInformation("Загрузка заказов");
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки заказов");
_logger.LogError(ex, "Ошибка загрузки изделий");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}