private void Form1_Load(object sender, EventArgs e) { SetMasterBindingNavigator(null); tabPage1.BackColor = this.BackColor; tabPage2.BackColor = this.BackColor; tabPage3.BackColor = this.BackColor; //取得此表單的LoaderFormInfo fFormInfo = XSC.ClientLoader.FormInfo(this); //透過LoginUserId取得sqlClientAccess sca = XSC.ClientAccess.UserAccess.sqlUserAccess(fFormInfo.LoginUserId); //fFormInfo.UserId; comboBox1.SelectedIndex = 0; object[] objParam = { "@userid", SqlDbType.NVarChar.ToString(), fFormInfo.LoginUserId }; cmdstring = "Select EMPID From XSC_Menu_Userlist where XSC_UserID=@userid"; DataTable dt = sca.GetDataTable("EEPDC", cmdstring, objParam, 0); if (dt.Rows.Count > 0) { Global.Globalparameter.UserName = dt.Rows[0]["EMPID"].ToString(); } else { MessageBox.Show("找不到工號,無法使用外掛"); Global.Globalparameter.UserName = ""; button_Search.Enabled = false; } toolStripStatusLabel1.Text = "XSC使用者:" + fFormInfo.UserId; toolStripStatusLabel2.Text = " WMS使用者工號:" + Global.Globalparameter.UserName; }
private void TestForm03_Load(object sender, EventArgs e) { //取得此表單的LoaderFormInfo fFormInfo = XSC.ClientLoader.FormInfo(this); //透過LoginUserId取得sqlClientAccess sca = XSC.ClientAccess.UserAccess.sqlUserAccess(fFormInfo.LoginUserId); comboBox1.SelectedIndex = 0; }
private void Form2_Load(object sender, EventArgs e) { fFormInfo = XSC.ClientLoader.FormInfo(this); sca1 = XSC.ClientAccess.UserAccess.sqlUserAccess(fFormInfo.LoginUserId); string sql = string.Format("select GROUPNAME from workitem_jack where wkclass='{0}'", v1); dt1 = sca1.GetDataTable(v2, sql); if (dt1.Rows.Count > 0) { v4 = dt1.Rows[0][0].ToString(); } view1(); }
private void Form1_Load(object sender, EventArgs e) { //取得此表單的LoaderFormInfo fFormInfo = XSC.ClientLoader.FormInfo(this); //透過LoginUserId取得sqlClientAccess sca = XSC.ClientAccess.UserAccess.sqlUserAccess(fFormInfo.LoginUserId); SetButtonEnable("L"); ResizeForm.ResizeForm.WSC_Resize(this, 1); label1.MaximumSize = new System.Drawing.Size(button1.Size.Width, 0); label2.MaximumSize = label1.MaximumSize; comboBox1.SelectedIndex = 0; }
private void Form1_Load(object sender, EventArgs e) { this.Text = "PO,RJ 產生PDF v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion.ToString(); //取得此表單的LoaderFormInfo fFormInfo = XSC.ClientLoader.FormInfo(this); //透過LoginUserId取得sqlClientAccess sca = XSC.ClientAccess.UserAccess.sqlUserAccess(fFormInfo.LoginUserId); label_Host.Text = fFormInfo.UserId;//fFormInfo.UserId; IPAddress[] iplist = Dns.GetHostEntry(Dns.GetHostName()).AddressList; bool ismatch; foreach (IPAddress ip in iplist) { ismatch = Regex.IsMatch(ip.ToString(), ("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")); if (ismatch == true) { label_IP.Text = ip.ToString() + "\n"; break; } } //設定預設值 cmb_DockMode.SelectedIndex = 0; txb_POID.Text = "P" + DateTime.Today.AddDays(-2).ToString("yyyyMMdd").Substring(2, 4); rdb_SelectPO.ForeColor = Color.Red; SetStatusString(0); label3.Text = "長度:" + txb_POID.Text.Length.ToString() + " (Max 13)"; label5.Text = "長度:" + txb_SupID.Text.Length.ToString() + " (Max 4)"; dtp_BDate.Value = DateTime.Today.AddDays(-3); dtp_EDate.Value = DateTime.Today.AddDays(3); //測試時使用 //textBox_POID.Text = "5714010100080"; //dateTimePicker1.Value = DateTime.Today.AddDays(-20); radioButton1_CheckedChanged(rdb_SelectPO, e); }
protected override void New_WSC_DLL_Form_Load(object sender, EventArgs e) { base.New_WSC_DLL_Form_Load(sender, e); panel_IKnow.Size = new Size(844, 639); panel_IKnow.Location = new Point(61, 38); //取得此表單的LoaderFormInfo fFormInfo = XSC.ClientLoader.FormInfo(this); //透過LoginUserId取得sqlClientAccess sca = XSC.ClientAccess.UserAccess.sqlUserAccess(fFormInfo.LoginUserId); #region 帳號權限判斷 Boolean IsCorrectUser = false, IsPXWMS_N = false, IsPXWMS_S = false, IsPXWMS_C = false; //取得工號 string cmdstring = "Select EMPID From XSC_Menu_Userlist where XSC_UserID=@userid"; object[] objParam = { "@userid", SqlDbType.NVarChar.ToString(), fFormInfo.LoginUserId }; DataTable dt_87 = sca.GetDataTable("EEPDC", cmdstring, objParam, 0); if (dt_87.Rows.Count > 0) { IsCorrectUser = true; UserWorkNum = dt_87.Rows[0][0].ToString(); } if (UserWorkNum != "") { //取得兩倉權限 //觀音 cmdstring = "select top 1 0 from employee_data where S_empd_id=@userid"; object[] objParam1 = { "@userid", SqlDbType.NVarChar.ToString(), UserWorkNum }; DataTable dt_PXWMS_N = sca.GetDataTable("PXWMS_N", cmdstring, objParam1, 0); if (dt_PXWMS_N.Rows.Count > 0) { IsPXWMS_N = true; } //岡山 DataTable dt_PXWMS_S = sca.GetDataTable("PXWMS_S", cmdstring, objParam1, 0); if (dt_PXWMS_S.Rows.Count > 0) { IsPXWMS_S = true; } //梧棲 DataTable dt_PXWMS_C = sca.GetDataTable("PXWMS_C_Plus2", cmdstring, objParam1, 0); if (dt_PXWMS_C.Rows.Count > 0) { IsPXWMS_C = true; } } if (IsPXWMS_N == false && IsPXWMS_S == false && IsPXWMS_C == false) { IsCorrectUser = false; } #endregion if (!IsCorrectUser) { MessageBox.Show("帳號無法對應三倉權限,請洽資訊部人員", ":<"); SetMasterBindingNavigator(null); SetButtonEnable("L"); return; } txb_ItemNo.Text = txb_Merdid.Text; SetMasterBindingNavigator(BS_Repl); SetButtonEnable("FL"); if (IsPXWMS_N) { comboBox1.Items.Add(new Item("觀音", "PXWMS_N")); } if (IsPXWMS_S) { comboBox1.Items.Add(new Item("岡山", "PXWMS_S")); } if (IsPXWMS_C) { comboBox1.Items.Add(new Item("梧棲", "PXWMS_C_Plus2")); } comboBox1.Items.Add(new Item("測試", "PXWMS_200")); comboBox1.SelectedIndex = 0; cB_SFCkind.Items.Add(new Item("SFCXX01", "SFC%01")); cB_SFCkind.Items.Add(new Item("SFCXX02", "SFC%02")); cB_SFCkind.Items.Add(new Item("出貨暫存", "%%")); cB_SFCkind.Items.Add(new Item("任意儲位", "%%")); cB_SFCkind.SelectedIndex = 0; ResizeForm.ResizeForm.WSC_Resize(this, 1); gridControl1.DataSource = BS_Repl; DevExpressGridFunctions.GridviewSetup(gridView1); DevExpressGridFunctions.GridviewSetup(gridView2); }
protected override void New_WSC_DLL_Form_Load(object sender, EventArgs e) { base.New_WSC_DLL_Form_Load(sender, e); //批次的解說文 toolTip1.SetToolTip(txb_SupdId, "輸入完供應商代號, 按下Tab"); cmb_BatchID.SelectedIndex = 0; //取得此表單的LoaderFormInfo fFormInfo = XSC.ClientLoader.FormInfo(this); //透過LoginUserId取得sqlClientAccess sca = XSC.ClientAccess.UserAccess.sqlUserAccess(fFormInfo.LoginUserId); #region 帳號權限判斷 Boolean IsCorrectUser = false; bool IsPXWMS_N = false, IsPXWMS_S = false, IsPXWMS_C = false; //取得工號 string cmdstring = "Select EMPID From XSC_Menu_Userlist where XSC_UserID=@userid"; object[] objParam = { "@userid", SqlDbType.NVarChar.ToString(), fFormInfo.LoginUserId }; DataTable dt_87 = sca.GetDataTable("EEPDC", cmdstring, objParam, 0); if (dt_87.Rows.Count > 0) { IsCorrectUser = true; UserWorkNum = dt_87.Rows[0][0].ToString(); } if (UserWorkNum != "") { //取得兩倉權限 //觀音 cmdstring = "select top 1 0 from employee_data where S_empd_id=@userid"; object[] objParam1 = { "@userid", SqlDbType.NVarChar.ToString(), UserWorkNum }; DataTable dt_PXWMS_N = sca.GetDataTable("PXWMS_N", cmdstring, objParam1, 0); if (dt_PXWMS_N.Rows.Count > 0) { IsPXWMS_N = true; } //岡山 DataTable dt_PXWMS_S = sca.GetDataTable("PXWMS_S", cmdstring, objParam1, 0); if (dt_PXWMS_S.Rows.Count > 0) { IsPXWMS_S = true; } //梧棲 DataTable dt_PXWMS_C = sca.GetDataTable("PXWMS_C_Plus2", cmdstring, objParam1, 0); if (dt_PXWMS_C.Rows.Count > 0) { IsPXWMS_C = true; } } if (IsPXWMS_N == false && IsPXWMS_S == false && IsPXWMS_C == false) { IsCorrectUser = false; } #endregion if (!IsCorrectUser) { MessageBox.Show("帳號無法對應三倉權限,請洽資訊部人員", ":<"); SetMasterBindingNavigator(null); SetButtonEnable("L"); return; } #region 設定新刪修會用到的物件 List <object> Enable_objlist = new List <object>(); Enable_objlist.Add(gridControl1); this.MasterObj = Enable_objlist; #endregion SetMasterBindingNavigator(BS_Repl); SetButtonEnable("FL EX help"); #region 限對應三倉 bindingNavigatorEditButton.Text = "重新產生資料(&E)"; if (IsPXWMS_N) { cmb_SiteNo.Items.Add(new Item("觀音", "PXWMS_N")); } if (IsPXWMS_S) { cmb_SiteNo.Items.Add(new Item("岡山", "PXWMS_S")); } if (IsPXWMS_C) { cmb_SiteNo.Items.Add(new Item("梧棲", "PXWMS_C_Plus2")); } cmb_SiteNo.SelectedIndex = 0; #endregion ResizeForm.ResizeForm.WSC_Resize(this, 1); //gridControl1.DataSource = BS_Repl; dateTimePicker1.Value = DateTime.Now.AddDays(3); DevExpressGridFunctions.GridviewSetup(gridView1); DevExpressGridFunctions.GridviewSetup(gridView2); DevExpressGridFunctions.GridviewSetup(gridView3); btn_Close_panel1.ForeColor = Color.White; btn_Close_panel1.BackColor = Color.Red; Lbl_UserId.Text = fFormInfo.LoginUserId; Lbl_WorkNum.Text = UserWorkNum; Lbl_Version.Text = "版本:" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion.ToString(); #region 獲取廠商清單 DataTable dt_VendorList = GetSupdId(); foreach (DataRow dr in dt_VendorList.Rows) { cmb_VendorNo.Items.Add(new Item(dr["NewAlias"].ToString(), dr["NewAlias"].ToString())); } #endregion }