파트리스트 금액칸 9백에서 9조로 수정 함 (붙여넣기 값 오류 있었음)

This commit is contained in:
chi
2020-05-11 13:00:44 +09:00
parent f68c0a0ea4
commit 91c2ddc961
17 changed files with 720 additions and 470 deletions

View File

@@ -31,15 +31,13 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fLogin));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.cmbDept = new System.Windows.Forms.ComboBox();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.tbID = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tbPW = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.btLogin = new System.Windows.Forms.Button();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
@@ -59,8 +57,6 @@
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(244)))));
this.panel1.Controls.Add(this.linkLabel2);
this.panel1.Controls.Add(this.linkLabel1);
this.panel1.Controls.Add(this.cmbDept);
this.panel1.Controls.Add(this.tbID);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
@@ -69,36 +65,28 @@
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(488, 366);
this.panel1.Size = new System.Drawing.Size(488, 276);
this.panel1.TabIndex = 0;
//
// linkLabel1
// linkLabel2
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Font = new System.Drawing.Font("맑은 고딕", 9F);
this.linkLabel1.Location = new System.Drawing.Point(12, 126);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(31, 15);
this.linkLabel1.TabIndex = 0;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "부서";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// cmbDept
//
this.cmbDept.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbDept.Font = new System.Drawing.Font("Calibri", 20.25F);
this.cmbDept.FormattingEnabled = true;
this.cmbDept.Location = new System.Drawing.Point(15, 144);
this.cmbDept.Name = "cmbDept";
this.cmbDept.Size = new System.Drawing.Size(460, 41);
this.cmbDept.TabIndex = 1;
this.linkLabel2.AutoSize = true;
this.linkLabel2.Font = new System.Drawing.Font("맑은 고딕", 9F);
this.linkLabel2.ForeColor = System.Drawing.Color.DodgerBlue;
this.linkLabel2.LinkColor = System.Drawing.Color.DodgerBlue;
this.linkLabel2.Location = new System.Drawing.Point(13, 247);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(243, 15);
this.linkLabel2.TabIndex = 7;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "문의 ) Chickyun.kim@amkor.co.kr, T.8567";
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
//
// tbID
//
this.tbID.Font = new System.Drawing.Font("Calibri", 20.25F);
this.tbID.FormattingEnabled = true;
this.tbID.Location = new System.Drawing.Point(15, 217);
this.tbID.Location = new System.Drawing.Point(16, 125);
this.tbID.Name = "tbID";
this.tbID.Size = new System.Drawing.Size(460, 41);
this.tbID.TabIndex = 3;
@@ -108,7 +96,7 @@
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("맑은 고딕", 9F);
this.label2.ForeColor = System.Drawing.Color.Gray;
this.label2.Location = new System.Drawing.Point(12, 272);
this.label2.Location = new System.Drawing.Point(13, 181);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(31, 15);
this.label2.TabIndex = 4;
@@ -119,7 +107,7 @@
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("맑은 고딕", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.Gray;
this.label1.Location = new System.Drawing.Point(12, 200);
this.label1.Location = new System.Drawing.Point(13, 108);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(55, 15);
this.label1.TabIndex = 2;
@@ -128,7 +116,7 @@
// tbPW
//
this.tbPW.Font = new System.Drawing.Font("Calibri", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tbPW.Location = new System.Drawing.Point(15, 291);
this.tbPW.Location = new System.Drawing.Point(16, 199);
this.tbPW.Name = "tbPW";
this.tbPW.PasswordChar = '●';
this.tbPW.Size = new System.Drawing.Size(460, 40);
@@ -140,7 +128,7 @@
this.panel2.BackColor = System.Drawing.SystemColors.Control;
this.panel2.Controls.Add(this.btLogin);
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel2.Location = new System.Drawing.Point(0, 366);
this.panel2.Location = new System.Drawing.Point(0, 276);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(488, 34);
this.panel2.TabIndex = 6;
@@ -156,25 +144,11 @@
this.btLogin.UseVisualStyleBackColor = true;
this.btLogin.Click += new System.EventHandler(this.button1_Click);
//
// linkLabel2
//
this.linkLabel2.AutoSize = true;
this.linkLabel2.Font = new System.Drawing.Font("맑은 고딕", 9F);
this.linkLabel2.ForeColor = System.Drawing.Color.DodgerBlue;
this.linkLabel2.LinkColor = System.Drawing.Color.DodgerBlue;
this.linkLabel2.Location = new System.Drawing.Point(12, 339);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(243, 15);
this.linkLabel2.TabIndex = 7;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "문의 ) Chickyun.kim@amkor.co.kr, T.8567";
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
//
// fLogin
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.OrangeRed;
this.ClientSize = new System.Drawing.Size(488, 400);
this.ClientSize = new System.Drawing.Size(488, 310);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@@ -202,8 +176,6 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox tbID;
private System.Windows.Forms.ComboBox cmbDept;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.LinkLabel linkLabel2;
}
}

View File

@@ -28,10 +28,10 @@ namespace Project.Dialog
if (item != "") tbID.Items.Add(item);
if (tbID.Items.Count > 0) tbID.SelectedIndex = 0;
var dlist = Pub.setting.lastdept.Split(';');
foreach (var item in dlist)
if (item != "") this.cmbDept.Items.Add(item);
if (cmbDept.Items.Count > 0) cmbDept.SelectedIndex = 0;
//var dlist = Pub.setting.lastdept.Split(';');
//foreach (var item in dlist)
// if (item != "") this.cmbDept.Items.Add(item);
//if (cmbDept.Items.Count > 0) cmbDept.SelectedIndex = 0;
this.Show();
Application.DoEvents();
@@ -58,22 +58,22 @@ namespace Project.Dialog
foreach (var item in this.tbID.Items)
if (idlist.Contains(item) == false) idlist.Add(item.ToString());
List<string> deptlist = new List<string>();
deptlist.Add(cmbDept.Text.Trim());
foreach (var item in this.cmbDept.Items)
if (deptlist.Contains(item) == false) deptlist.Add(item.ToString());
//List<string> deptlist = new List<string>();
//deptlist.Add(cmbDept.Text.Trim());
//foreach (var item in this.cmbDept.Items)
// if (deptlist.Contains(item) == false) deptlist.Add(item.ToString());
//180605
var vuserlist = "";
foreach (var item in idlist)
vuserlist += ";" + item;
var vdeptlist = "";
foreach(var item in deptlist)
vdeptlist += ";" + item;
//var vdeptlist = "";
//foreach(var item in deptlist)
// vdeptlist += ";" + item;
Pub.setting.lastid = vuserlist;// tbID.Text.Trim();
Pub.setting.lastdept = vdeptlist;
// Pub.setting.lastdept = vdeptlist;
Pub.setting.Save();
var encpass = Pub.MakePasswordEnc(tbPW.Text.Trim());
@@ -95,23 +95,23 @@ namespace Project.Dialog
//이사용자의 부서 코드확인
var userdr = users.Rows[0] as dsMSSQL.UsersRow;
if (userdr.level < 9 && userdr.dept != cmbDept.Text)
{
Util.MsgE("입력한 사용자는 지정한 부서에 접속할 권한이 없습니다");
return;
}
//if (userdr.level < 9 && userdr.dept != cmbDept.Text)
//{
// Util.MsgE("입력한 사용자는 지정한 부서에 접속할 권한이 없습니다");
// return;
//}
FCOMMON.info.Login.no = userdr.id;
FCOMMON.info.Login.nameK = userdr.name;
FCOMMON.info.Login.dept = cmbDept.Text;
FCOMMON.info.Login.dept = userdr.dept;// cmbDept.Text;
FCOMMON.info.Login.level = userdr.level;
FCOMMON.info.Login.email = userdr.email;
FCOMMON.info.Login.nameE = userdr.nameE;
FCOMMON.info.Login.hp = userdr.hp;
FCOMMON.info.Login.tel = userdr.tel;
FCOMMON.info.Login.title = userdr.ads_title;
var gcode = FCOMMON.DBM.ExecuteScalar("select isnull(gcode,'NOGCODE') from UserGroup where dept ='" + cmbDept.Text + "'");
var gperm = FCOMMON.DBM.ExecuteScalar("select isnull(permission,0) from UserGroup where dept ='" + cmbDept.Text + "'");
var gcode = FCOMMON.DBM.ExecuteScalar("select isnull(gcode,'NOGCODE') from UserGroup where dept ='" + userdr.dept + "'");
var gperm = FCOMMON.DBM.ExecuteScalar("select isnull(permission,0) from UserGroup where dept ='" + userdr.dept + "'");
FCOMMON.info.Login.gcode = gcode;
FCOMMON.info.Login.process = userdr.processs;
FCOMMON.info.Login.permission = 0;
@@ -133,13 +133,13 @@ namespace Project.Dialog
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
var f = new Dialog.fSelectDept();
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
if (cmbDept.Items.Contains(f.deptName) == false)
cmbDept.Items.Add(f.deptName);
cmbDept.Text = f.deptName;
}
//var f = new Dialog.fSelectDept();
//if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
//{
// if (cmbDept.Items.Contains(f.deptName) == false)
// cmbDept.Items.Add(f.deptName);
// cmbDept.Text = f.deptName;
//}
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로
// 지정되도록 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("20.05.07.1700")]
[assembly: AssemblyFileVersion("20.05.07.1700")]
[assembly: AssemblyVersion("20.05.11.1300")]
[assembly: AssemblyFileVersion("20.05.11.1300")]

View File

@@ -1,257 +1,266 @@
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;
using System.DirectoryServices;
namespace Project._Common
{
public partial class fADSUserList : FCOMMON.fBase
{
public fADSUserList()
{
InitializeComponent();
}
private void fADSUserList_Load(object sender, EventArgs e)
{
this.lbDomain.Text = this.DomainName();
this.btInsert.Visible = (FCOMMON.info.Login.level > 9);
this.tbEntry.Text = "LDAP://OU=Office,OU=Users,OU=People,OU=K4,DC=kr,DC=ds,DC=amkor,DC=com";
this.tbEntry.Enabled = this.btInsert.Visible;
}
public string DomainName()
{
var objRootDSE = new DirectoryEntry("LDAP://RootDSE");
return objRootDSE.Properties["defaultNamingContext"][0].ToString();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
this.listView1.Items.Clear();
this.listView1.Columns.Clear();
this.listView1.CheckBoxes = true;
this.listView1.Columns.Add("sn");
this.listView1.Columns.Add("cn");
this.listView1.Columns.Add("disp");
this.listView1.Columns.Add("dept");
this.listView1.Columns.Add("title");
this.listView1.Columns.Add("tel");
this.listView1.Columns.Add("mail");
this.listView1.Columns.Add("pager");
this.listView1.Columns.Add("empno");
this.listView1.Columns.Add("when");
this.listView1.Visible = false;
this.listView1.View = View.Details;
string[] propliest = new string[] { "whenCreated", "telephonenumber", "title", "employeeNumber", "department", "displayName", "mail", "pager", "sn", "cn" };
Boolean skipuser = false;
string dept = string.Empty;
string whencre = string.Empty;
string empno = string.Empty;
string disp = string.Empty;
string cn = string.Empty;
string sn = string.Empty;
string mail = string.Empty;
string title = string.Empty;
string pager = string.Empty;
string tel = string.Empty;
var deParent = new DirectoryEntry(tbEntry.Text);
string Nodename = "";
try
{
Nodename = deParent.SchemaClassName;
} catch (Exception ex)
{
Util.MsgE(ex.Message + "\n" + tbEntry.Text);
Nodename = string.Empty;
}
if (Nodename != "")
{
if (deParent.Name.StartsWith("CN"))
{
//특정사용자 조회
foreach (string listIter in propliest)
{
foreach (object Iter in deParent.Properties[listIter.ToString()])
{
string strvalue = Iter.ToString();
switch (listIter.ToString().ToLower())
{
case "department":
dept = strvalue;
// var search = toolStripTextBox1.Text.Trim();
// if (search != "") if (dept.IndexOf(search) == -1) skipuser = true;
break;
case "whencreated": whencre = strvalue; break;
case "title": title = strvalue; break;
case "telephonenumber": tel = strvalue; break;
case "employeenumber": empno = strvalue; break;
case "displayname": disp = strvalue; break;
case "mail": mail = strvalue; break;
case "pager": pager = strvalue; break;
case "sn": sn = strvalue; break;
case "cn": cn = strvalue; break;
}
// if (skipuser) break;
}
// if (skipuser) break;
}
var lv = this.listView1.Items.Add(sn);
lv.Checked = true;
lv.SubItems.Add(cn);
lv.SubItems.Add(disp);
lv.SubItems.Add(dept);
lv.SubItems.Add(title);
lv.SubItems.Add(tel);
lv.SubItems.Add(mail);
lv.SubItems.Add(pager);
lv.SubItems.Add(empno);
lv.SubItems.Add(whencre);
}
else
{
foreach (DirectoryEntry deChild in deParent.Children)
{
skipuser = false;
dept = string.Empty;
whencre = string.Empty;
empno = string.Empty;
disp = string.Empty;
cn = string.Empty;
sn = string.Empty;
mail = string.Empty;
title = string.Empty;
pager = string.Empty;
tel = string.Empty;
foreach (string listIter in propliest)
{
foreach (object Iter in deChild.Properties[listIter.ToString()])
{
string strvalue = Iter.ToString();
switch (listIter.ToString().ToLower())
{
case "department":
dept = strvalue;
var search = toolStripTextBox1.Text.Trim();
if (search != "") if (dept.IndexOf(search) == -1) skipuser = true;
break;
case "whencreated": whencre = strvalue; break;
case "title": title = strvalue; break;
case "telephonenumber": tel = strvalue; break;
case "employeenumber": empno = strvalue; break;
case "displayname": disp = strvalue; break;
case "mail": mail = strvalue; break;
case "pager": pager = strvalue; break;
case "sn": sn = strvalue; break;
case "cn": cn = strvalue; break;
}
if (skipuser) break;
}
if (skipuser) break;
}
if (sn == "" || pager == "" || sn.ToUpper().StartsWith("k4") || sn.ToUpper().StartsWith("test")) skipuser = true;
if (skipuser) continue;
var lv = this.listView1.Items.Add(sn);
lv.Checked = true;
lv.SubItems.Add(cn);
lv.SubItems.Add(disp);
lv.SubItems.Add(dept);
lv.SubItems.Add(title);
lv.SubItems.Add(tel);
lv.SubItems.Add(mail);
lv.SubItems.Add(pager);
lv.SubItems.Add(empno);
lv.SubItems.Add(whencre);
if (listView1.Items.Count > 500) break;
}
}
}
FCOMMON.Util.MsgI("exit");
this.listView1.Visible = true;
}
private void btInsert_Click(object sender, EventArgs e)
{
System.Text.StringBuilder sb = new StringBuilder();
var items = this.listView1.CheckedItems;
sb.AppendLine("현재 목록의 선택된 자료를 입력하시겠습니까?");
sb.AppendLine("건수 : " + items.Count.ToString());
var dlg = FCOMMON.Util.MsgQ(sb.ToString());
if (dlg != System.Windows.Forms.DialogResult.Yes) return;
this.prb1.Maximum = items.Count;
this.prb1.Value = 0;
foreach(ListViewItem item in items)
{
string sn = item.SubItems[0].Text;
string cn = item.SubItems[1].Text;
string disp = item.SubItems[2].Text;// lv.SubItems.Add(disp);
string dept = item.SubItems[3].Text; // lv.SubItems.Add(dept);
string title = item.SubItems[4].Text;// lv.SubItems.Add(title);
string tel = item.SubItems[5].Text; // lv.SubItems.Add(tel);
string mail = item.SubItems[6].Text; // lv.SubItems.Add(mail);
string pager = item.SubItems[7].Text; // lv.SubItems.Add(pager);
string empno = item.SubItems[8].Text; // lv.SubItems.Add(empno);
string whencre = item.SubItems[9].Text; // lv.SubItems.Add(whencre);
try
{
taUser.InsertADSInfo(
pager, disp, sn, dept,
mail, tel, empno,title,
whencre,
"Auto Gen", FCOMMON.info.Login.no, DateTime.Now );
}
catch (Exception eX)
{
Console.WriteLine(sn + eX.Message);
}
this.prb1.Value += 1;
}
}
private void allSelectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in this.listView1.Items)
item.Checked = true;
}
private void deSelectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in this.listView1.Items)
item.Checked = !item.Checked;
}
private void unSelectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in this.listView1.Items)
item.Checked = false;
}
}
}
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;
using System.DirectoryServices;
namespace Project._Common
{
public partial class fADSUserList : FCOMMON.fBase
{
public fADSUserList()
{
InitializeComponent();
}
private void fADSUserList_Load(object sender, EventArgs e)
{
this.lbDomain.Text = this.DomainName();
this.btInsert.Visible = (FCOMMON.info.Login.level > 9);
this.tbEntry.Text = "LDAP://OU=Office,OU=Users,OU=People,OU=K4,DC=kr,DC=ds,DC=amkor,DC=com";
this.tbEntry.Enabled = this.btInsert.Visible;
}
public string DomainName()
{
var objRootDSE = new DirectoryEntry("LDAP://RootDSE");
return objRootDSE.Properties["defaultNamingContext"][0].ToString();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
this.listView1.Items.Clear();
this.listView1.Columns.Clear();
this.listView1.CheckBoxes = true;
this.listView1.Columns.Add("sn");
this.listView1.Columns.Add("cn");
this.listView1.Columns.Add("disp");
this.listView1.Columns.Add("dept");
this.listView1.Columns.Add("title");
this.listView1.Columns.Add("tel");
this.listView1.Columns.Add("mail");
this.listView1.Columns.Add("pager");
this.listView1.Columns.Add("empno");
this.listView1.Columns.Add("when");
this.listView1.Visible = false;
this.listView1.View = View.Details;
string[] propliest = new string[] { "whenCreated", "telephonenumber", "title", "employeeNumber", "department", "displayName", "mail", "pager", "sn", "cn" };
Boolean skipuser = false;
string dept = string.Empty;
string whencre = string.Empty;
string empno = string.Empty;
string disp = string.Empty;
string cn = string.Empty;
string sn = string.Empty;
string mail = string.Empty;
string title = string.Empty;
string pager = string.Empty;
string tel = string.Empty;
var deParent = new DirectoryEntry(tbEntry.Text);
string Nodename = "";
try
{
Nodename = deParent.SchemaClassName;
} catch (Exception ex)
{
Util.MsgE(ex.Message + "\n" + tbEntry.Text);
Nodename = string.Empty;
}
if (Nodename != "")
{
if (deParent.Name.StartsWith("CN"))
{
//특정사용자 조회
foreach (string listIter in propliest)
{
foreach (object Iter in deParent.Properties[listIter.ToString()])
{
string strvalue = Iter.ToString();
switch (listIter.ToString().ToLower())
{
case "department":
dept = strvalue;
// var search = toolStripTextBox1.Text.Trim();
// if (search != "") if (dept.IndexOf(search) == -1) skipuser = true;
break;
case "whencreated": whencre = strvalue; break;
case "title": title = strvalue; break;
case "telephonenumber": tel = strvalue; break;
case "employeenumber": empno = strvalue; break;
case "displayname": disp = strvalue; break;
case "mail": mail = strvalue; break;
case "pager": pager = strvalue; break;
case "sn": sn = strvalue; break;
case "cn": cn = strvalue; break;
}
// if (skipuser) break;
}
// if (skipuser) break;
}
var lv = this.listView1.Items.Add(sn);
lv.Checked = true;
lv.SubItems.Add(cn);
lv.SubItems.Add(disp);
lv.SubItems.Add(dept);
lv.SubItems.Add(title);
lv.SubItems.Add(tel);
lv.SubItems.Add(mail);
lv.SubItems.Add(pager);
lv.SubItems.Add(empno);
lv.SubItems.Add(whencre);
}
else
{
foreach (DirectoryEntry deChild in deParent.Children)
{
skipuser = false;
dept = string.Empty;
whencre = string.Empty;
empno = string.Empty;
disp = string.Empty;
cn = string.Empty;
sn = string.Empty;
mail = string.Empty;
title = string.Empty;
pager = string.Empty;
tel = string.Empty;
foreach (string listIter in propliest)
{
foreach (object Iter in deChild.Properties[listIter.ToString()])
{
string strvalue = Iter.ToString();
switch (listIter.ToString().ToLower())
{
case "department":
dept = strvalue;
var search = toolStripTextBox1.Text.Trim();
if (search != "") if (dept.IndexOf(search) == -1) skipuser = true;
break;
case "whencreated": whencre = strvalue; break;
case "title": title = strvalue; break;
case "telephonenumber": tel = strvalue; break;
case "employeenumber": empno = strvalue; break;
case "displayname": disp = strvalue; break;
case "mail": mail = strvalue; break;
case "pager": pager = strvalue; break;
case "sn": sn = strvalue; break;
case "cn": cn = strvalue; break;
}
if (skipuser) break;
}
if (skipuser) break;
}
if (sn == "" || pager == "" || sn.ToUpper().StartsWith("k4") || sn.ToUpper().StartsWith("test")) skipuser = true;
if (skipuser) continue;
var lv = this.listView1.Items.Add(sn);
lv.Checked = true;
lv.SubItems.Add(cn);
lv.SubItems.Add(disp);
lv.SubItems.Add(dept);
lv.SubItems.Add(title);
lv.SubItems.Add(tel);
lv.SubItems.Add(mail);
lv.SubItems.Add(pager);
lv.SubItems.Add(empno);
lv.SubItems.Add(whencre);
if (listView1.Items.Count > 500) break;
}
}
}
FCOMMON.Util.MsgI("exit");
this.listView1.Visible = true;
}
private void btInsert_Click(object sender, EventArgs e)
{
System.Text.StringBuilder sb = new StringBuilder();
var items = this.listView1.CheckedItems;
sb.AppendLine("현재 목록의 선택된 자료를 입력하시겠습니까?");
sb.AppendLine("건수 : " + items.Count.ToString());
var dlg = FCOMMON.Util.MsgQ(sb.ToString());
if (dlg != System.Windows.Forms.DialogResult.Yes) return;
this.prb1.Maximum = items.Count;
this.prb1.Value = 0;
foreach(ListViewItem item in items)
{
string sn = item.SubItems[0].Text;
string cn = item.SubItems[1].Text;
string disp = item.SubItems[2].Text;// lv.SubItems.Add(disp);
string dept = item.SubItems[3].Text; // lv.SubItems.Add(dept);
string title = item.SubItems[4].Text;// lv.SubItems.Add(title);
string tel = item.SubItems[5].Text; // lv.SubItems.Add(tel);
string mail = item.SubItems[6].Text; // lv.SubItems.Add(mail);
string pager = item.SubItems[7].Text; // lv.SubItems.Add(pager);
string empno = item.SubItems[8].Text; // lv.SubItems.Add(empno);
string whencre = item.SubItems[9].Text; // lv.SubItems.Add(whencre);
try
{
//이 대상의 id가 잇는지 체크한다.
if(taUser.ExistID(pager) > 0)
{
taUser.UpdateDept(dept, pager);
}
else
{
taUser.InsertADSInfo(
pager, disp, sn, dept,
mail, tel, empno, title,
whencre,
"Auto Gen", FCOMMON.info.Login.no, DateTime.Now);
}
}
catch (Exception eX)
{
Console.WriteLine(sn + eX.Message);
}
this.prb1.Value += 1;
}
}
private void allSelectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in this.listView1.Items)
item.Checked = true;
}
private void deSelectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in this.listView1.Items)
item.Checked = !item.Checked;
}
private void unSelectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in this.listView1.Items)
item.Checked = false;
}
}
}

View File

@@ -6440,7 +6440,7 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
private void InitCommandCollection() {
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5];
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[7];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = @"SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, tel, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate, processs, gcode
@@ -6452,48 +6452,59 @@ ORDER BY name";
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@process", global::System.Data.SqlDbType.NVarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
this._commandCollection[1].CommandText = "SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te" +
"l, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate, processs," +
" gcode\r\nFROM Users\r\nWHERE (name = @username) AND (password = @encpw)";
this._commandCollection[1].CommandText = "SELECT COUNT(*) FROM Users where id = @userid";
this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@username", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@encpw", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "password", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@userid", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[2].Connection = this.Connection;
this._commandCollection[2].CommandText = "SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te" +
"l, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate, processs," +
" gcode\r\nFROM Users\r\nWHERE (id = @id)\r\nORDER BY name";
" gcode\r\nFROM Users\r\nWHERE (name = @username) AND (password = @encpw)";
this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@id", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@username", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@encpw", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "password", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[3].Connection = this.Connection;
this._commandCollection[3].CommandText = @"SELECT ads_created, ads_employNo, ads_title, dept, email, grade, hp, id, indate, level, memo, name, nameE, outdate, password, place, tel, wdate, wuid, processs, gcode
this._commandCollection[3].CommandText = "SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te" +
"l, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate, processs," +
" gcode\r\nFROM Users\r\nWHERE (id = @id)\r\nORDER BY name";
this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@id", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[4].Connection = this.Connection;
this._commandCollection[4].CommandText = @"SELECT ads_created, ads_employNo, ads_title, dept, email, grade, hp, id, indate, level, memo, name, nameE, outdate, password, place, tel, wdate, wuid, processs, gcode
FROM Users
WHERE (password = @encpw) AND (level > 0) AND (email = @idkey) OR
(password = @encpw) AND (level > 0) AND (id = @idkey) OR
(password = @encpw) AND (level > 0) AND (email = { fn CONCAT(@idkey, '@amkor.co.kr') })";
this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@encpw", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "password", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idkey", global::System.Data.SqlDbType.VarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "email", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[4].Connection = this.Connection;
this._commandCollection[4].CommandText = @"INSERT INTO Users
this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@encpw", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "password", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idkey", global::System.Data.SqlDbType.VarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "email", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[5].Connection = this.Connection;
this._commandCollection[5].CommandText = @"INSERT INTO Users
(id, password, nameE, name, dept, email, level, tel, ads_employNo, ads_title, ads_created, memo, wuid, wdate)
VALUES (@id, 'B6589FC6AB0DC82CF12099D1C2D40AB994E8410C',@nameE,@name,@dept,@email, 0,@tel,@ads_employNo,@ads_title,@ads_created,@memo,@wuid,@wdate);
SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, tel, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate FROM Users WHERE (id = @id) ORDER BY name";
this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@id", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@nameE", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "nameE", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@name", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dept", global::System.Data.SqlDbType.VarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "dept", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@email", global::System.Data.SqlDbType.VarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "email", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@tel", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "tel", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ads_employNo", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "ads_employNo", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ads_title", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "ads_title", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ads_created", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "ads_created", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@memo", global::System.Data.SqlDbType.NVarChar, 255, global::System.Data.ParameterDirection.Input, 0, 0, "memo", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@wuid", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "wuid", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@wdate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 0, 0, "wdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@id", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@nameE", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "nameE", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@name", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dept", global::System.Data.SqlDbType.VarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "dept", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@email", global::System.Data.SqlDbType.VarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "email", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@tel", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "tel", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ads_employNo", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "ads_employNo", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ads_title", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "ads_title", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ads_created", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, "ads_created", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@memo", global::System.Data.SqlDbType.NVarChar, 255, global::System.Data.ParameterDirection.Input, 0, 0, "memo", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@wuid", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "wuid", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@wdate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 0, 0, "wdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[6].Connection = this.Connection;
this._commandCollection[6].CommandText = "UPDATE Users\r\nSET dept = @dept\r\nWHERE (id = @Original_id); ";
this._commandCollection[6].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dept", global::System.Data.SqlDbType.VarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, "dept", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_id", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "id", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -6549,7 +6560,7 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
public virtual int FillByNamePw(dsMSSQL.UsersDataTable dataTable, string username, string encpw) {
this.Adapter.SelectCommand = this.CommandCollection[1];
this.Adapter.SelectCommand = this.CommandCollection[2];
if ((username == null)) {
this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
}
@@ -6574,7 +6585,7 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual dsMSSQL.UsersDataTable GetByNamePw(string username, string encpw) {
this.Adapter.SelectCommand = this.CommandCollection[1];
this.Adapter.SelectCommand = this.CommandCollection[2];
if ((username == null)) {
this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
}
@@ -6597,7 +6608,7 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
public virtual int FillID(dsMSSQL.UsersDataTable dataTable, string id) {
this.Adapter.SelectCommand = this.CommandCollection[2];
this.Adapter.SelectCommand = this.CommandCollection[3];
if ((id == null)) {
throw new global::System.ArgumentNullException("id");
}
@@ -6616,7 +6627,7 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual dsMSSQL.UsersDataTable GetID(string id) {
this.Adapter.SelectCommand = this.CommandCollection[2];
this.Adapter.SelectCommand = this.CommandCollection[3];
if ((id == null)) {
throw new global::System.ArgumentNullException("id");
}
@@ -6633,7 +6644,7 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
public virtual int FillIDPW(dsMSSQL.UsersDataTable dataTable, string encpw, string idkey) {
this.Adapter.SelectCommand = this.CommandCollection[3];
this.Adapter.SelectCommand = this.CommandCollection[4];
if ((encpw == null)) {
this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
}
@@ -6658,7 +6669,7 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual dsMSSQL.UsersDataTable GetIDPW(string encpw, string idkey) {
this.Adapter.SelectCommand = this.CommandCollection[3];
this.Adapter.SelectCommand = this.CommandCollection[4];
if ((encpw == null)) {
this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
}
@@ -7248,12 +7259,46 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
return this.Update(Original_id, password, nameE, name, dept, grade, email, level, indate, outdate, tel, hp, place, ads_employNo, ads_title, ads_created, memo, wuid, wdate, process, gcode, Original_id);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual global::System.Nullable<int> ExistID(string userid) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1];
if ((userid == null)) {
throw new global::System.ArgumentNullException("userid");
}
else {
command.Parameters[0].Value = ((string)(userid));
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
command.Connection.Open();
}
object returnValue;
try {
returnValue = command.ExecuteScalar();
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
command.Connection.Close();
}
}
if (((returnValue == null)
|| (returnValue.GetType() == typeof(global::System.DBNull)))) {
return new global::System.Nullable<int>();
}
else {
return new global::System.Nullable<int>(((int)(returnValue)));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, false)]
public virtual int InsertADSInfo(string id, string nameE, string name, string dept, string email, string tel, string ads_employNo, string ads_title, string ads_created, string memo, string wuid, System.DateTime wdate) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4];
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5];
if ((id == null)) {
throw new global::System.ArgumentNullException("id");
}
@@ -7337,6 +7382,41 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
}
return returnValue;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, false)]
public virtual int UpdateDept(string dept, string Original_id) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6];
if ((dept == null)) {
command.Parameters[0].Value = global::System.DBNull.Value;
}
else {
command.Parameters[0].Value = ((string)(dept));
}
if ((Original_id == null)) {
throw new global::System.ArgumentNullException("Original_id");
}
else {
command.Parameters[1].Value = ((string)(Original_id));
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
command.Connection.Open();
}
int returnValue;
try {
returnValue = command.ExecuteNonQuery();
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
command.Connection.Close();
}
}
return returnValue;
}
}
/// <summary>

View File

@@ -155,6 +155,16 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
<Mapping SourceColumn="gcode" DataSetColumn="gcode" />
</Mappings>
<Sources>
<DbSource ConnectionRef="gwcs (Settings)" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="ExistID" Modifier="Public" Name="ExistID" QueryType="Scalar" ScalarCallRetval="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="ExistID">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT COUNT(*) FROM Users where id = @userid</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="userid" ColumnName="id" DataSourceName="EE.dbo.Users" DataTypeServer="varchar(20)" DbType="AnsiString" Direction="Input" ParameterName="@userid" Precision="0" ProviderType="VarChar" Scale="0" Size="20" SourceColumn="id" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="gwcs (Settings)" DbObjectName="GroupWare.dbo.Users" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByNamePw" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetByNamePw" GeneratorSourceName="FillByNamePw" GetMethodModifier="Public" GetMethodName="GetByNamePw" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetByNamePw" UserSourceName="FillByNamePw">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
@@ -196,7 +206,7 @@ WHERE (password = @encpw) AND (level &gt; 0) AND (email = @idkey) OR
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="gwcs (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="InsertADSInfo" Modifier="Public" Name="InsertADSInfo" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="InsertADSInfo">
<DbSource ConnectionRef="gwcs (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="InsertADSInfo" Modifier="Public" Name="InsertADSInfo" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy1" UserSourceName="InsertADSInfo">
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>INSERT INTO Users
@@ -220,6 +230,19 @@ SELECT id, password, nameE, name, dept, grade, email, level, indate, outdate, te
</DbCommand>
</InsertCommand>
</DbSource>
<DbSource ConnectionRef="gwcs (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="UpdateDept" Modifier="Public" Name="UpdateDept" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy2" UserSourceName="UpdateDept">
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>UPDATE Users
SET dept = @dept
WHERE (id = @Original_id); </CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="dept" ColumnName="dept" DataSourceName="EE.dbo.Users" DataTypeServer="varchar(100)" DbType="AnsiString" Direction="Input" ParameterName="@dept" Precision="0" ProviderType="VarChar" Scale="0" Size="100" SourceColumn="dept" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="Original_id" ColumnName="id" DataSourceName="EE.dbo.Users" DataTypeServer="varchar(20)" DbType="AnsiString" Direction="Input" ParameterName="@Original_id" Precision="0" ProviderType="VarChar" Scale="0" Size="20" SourceColumn="id" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</Sources>
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ProjectsTableAdapter" GeneratorDataComponentClassName="ProjectsTableAdapter" Name="Projects" UserDataComponentName="ProjectsTableAdapter">

View File

@@ -4,9 +4,9 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="113" ViewPortY="-21" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="28" ViewPortY="-21" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:Users" ZOrder="3" X="38" Y="90" Height="554" Width="164" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="429" />
<Shape ID="DesignTable:Users" ZOrder="3" X="38" Y="90" Height="651" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="429" />
<Shape ID="DesignTable:Projects" ZOrder="8" X="208" Y="0" Height="149" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="59" />
<Shape ID="DesignTable:Items" ZOrder="7" X="205" Y="174" Height="476" Width="184" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="197" />
<Shape ID="DesignTable:Inventory" ZOrder="6" X="389" Y="17" Height="362" Width="234" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="292" />