Exemple #1
0
        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);
        }
Exemple #2
0
        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
        }