...
This commit is contained in:
89
Project/Dev/fDisableItem.Designer.cs
generated
Normal file
89
Project/Dev/fDisableItem.Designer.cs
generated
Normal file
@@ -0,0 +1,89 @@
|
||||
|
||||
namespace Project.Dev
|
||||
{
|
||||
partial class fDisableItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fDisableItem));
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.textBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.textBox1.Multiline = true;
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
|
||||
this.textBox1.Size = new System.Drawing.Size(269, 405);
|
||||
this.textBox1.TabIndex = 0;
|
||||
this.textBox1.Text = resources.GetString("textBox1.Text");
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.progressBar1.Location = new System.Drawing.Point(0, 405);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(800, 45);
|
||||
this.progressBar1.TabIndex = 1;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(295, 12);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(178, 56);
|
||||
this.button1.TabIndex = 2;
|
||||
this.button1.Text = "disable";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// fDisableItem
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Name = "fDisableItem";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "fDisableItem";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
||||
56
Project/Dev/fDisableItem.cs
Normal file
56
Project/Dev/fDisableItem.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Project.Dev
|
||||
{
|
||||
public partial class fDisableItem : Form
|
||||
{
|
||||
public fDisableItem()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
var lines = this.textBox1.Text.Replace("\r", "").Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
var dlg = Util.MsgQ($"{lines.Length} 건의 아이템 비활성화를 진행 할까요?");
|
||||
if (dlg != DialogResult.Yes) return;
|
||||
|
||||
this.progressBar1.Minimum = 0;
|
||||
this.progressBar1.Maximum = lines.Length;
|
||||
this.progressBar1.Value = 0;
|
||||
|
||||
var cn = new System.Data.SqlClient.SqlConnection(Properties.Settings.Default.gwcs);
|
||||
var cmd = new System.Data.SqlClient.SqlCommand("", cn);
|
||||
cn.Open();
|
||||
var cnt = 0;
|
||||
foreach(var item in lines)
|
||||
{
|
||||
this.progressBar1.Value += 1;
|
||||
if (item.StartsWith("10") == false) continue;
|
||||
var sql = $"update items set [disable]= 1 where [sid] = '{item.Trim()}' and gcode = '{FCOMMON.info.Login.gcode}'";
|
||||
cmd.CommandText = sql;
|
||||
cnt += cmd.ExecuteNonQuery();
|
||||
if (this.progressBar1.Value % 50 == 0)
|
||||
{
|
||||
this.Text = $"{cnt}/{progressBar1.Maximum}";
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
cmd.Dispose();
|
||||
cn.Close();
|
||||
Util.MsgI("ok = " + cnt.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
5358
Project/Dev/fDisableItem.resx
Normal file
5358
Project/Dev/fDisableItem.resx
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user