Esempio n. 1
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;
            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;
            
            string sLogUserid = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate = LoginInfo.operDate;
            string sAccID = LoginInfo.AccID;

            ClsUserRight clsUser = new ClsUserRight();
            if (clsUser.chkRight(login, "TH_28"))
            {
                SaleBillVouchCSV fm = new SaleBillVouchCSV();
                fm.Conn = conn;
                fm.sUserID = sLogUserid;
                fm.sUserName = sLogUserName;
                fm.sLogDate = sLogDate;
                fm.sAccID = sAccID;

                this._Title = "Export Invoice(CSV)";

                return fm;
            }
            else
            {
                MessageBox.Show("no rights");
                return null;
            }
        }
Esempio n. 2
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            ClsUserRight clsUser = new ClsUserRight();

            if (clsUser.chkRight(login, "UA2"))
            {
                成本对比表 fm = new 成本对比表();
                fm.Conn      = conn;
                fm.sUserID   = sLogUserid;
                fm.sUserName = sLogUserName;
                fm.sLogDate  = sLogDate;
                fm.sAccID    = sAccID;

                this._Title = "成本对比表";

                return(fm);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            //ClsUserRight clsUser = new ClsUserRight();
            //if (clsUser.chkRight(login, "TH_ETS_02"))
            //{
            ImportPackingList_Invoice fm = new ImportPackingList_Invoice();

            fm.Conn      = conn;
            fm.sUserID   = sLogUserid;
            fm.sUserName = sLogUserName;
            fm.sLogDate  = sLogDate;
            fm.sAccID    = sAccID;

            this._Title = "Import Excel";

            return(fm);
            //}
            //else
            //    return null;
        }
Esempio n. 4
0
        /// <summary>
        /// 功能:RF登录
        /// </summary>
        /// <param name="dBString">登入字符串</param>
        /// <returns></returns>
        public static int PrintU8Login(out string dBString)
        {
            int result = 11;

            dBString = "";
            UFSoft.U8.Framework.Login.UI.clsLogin g_NetLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();

            if (g_NetLogin.login("DP"))
            {
                //dBString = g_NetLogin.
                //UFSoft.U8.Framework.Login.UI.

                UFSoft.U8.Framework.LoginContext.UserData userData = g_NetLogin.GetLoginInfo();

                string sqlUser, sqlPassword, dataSource, catalog;

                SplitUserID(userData.ConnString, out sqlUser, out sqlPassword, out dataSource, out catalog);//解析返回数据串



                char[] a = new char[1];
                a[0]        = '\"';
                sqlUser     = sqlUser.Trim(a);
                sqlPassword = sqlPassword.Trim(a);
                dataSource  = dataSource.Trim(a);
                catalog     = catalog.Trim(a);


                dBString = "user id=" + sqlUser + ";password="******";data source=" + dataSource
                           + ";persist security info=True;initial catalog=" + catalog;
                return(0);
            }

            return(result);
        }
Esempio n. 5
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            ClsUserRight clsUser = new ClsUserRight();

            if (clsUser.chkRight(login, "TH_18"))
            {
                BarSalesShipment fm = new BarSalesShipment();
                fm.Conn      = conn;
                fm.sUserID   = sLogUserid;
                fm.sUserName = sLogUserName;
                fm.sLogDate  = sLogDate;
                fm.sAccID    = sAccID;

                this._Title = "Scan Sales Shipment";

                return(fm);
            }
            else
            {
                MessageBox.Show("no rights");
                return(null);
            }
        }
Esempio n. 6
0
        private void reloginMenuItem_Click(object sender, EventArgs e)
        {
            //显示U8门户登陆界面,处理用户登陆信息
            UFSoft.U8.Framework.Login.UI.clsLogin u8LoginUI = new UFSoft.U8.Framework.Login.UI.clsLogin();
            if (!u8LoginUI.login("DP"))
            {
                MessageBox.Show("登陆失败,原因:" + u8LoginUI.ErrDescript);
                u8LoginUI.ShutDown();
                return;
            }

            //从这个类里可以获取登陆信息、数据库连接信息等等
            UFSoft.U8.Framework.LoginContext.UserData u8userdata = new UFSoft.U8.Framework.LoginContext.UserData();
            u8userdata = u8LoginUI.GetLoginInfo();

            Pubvar.gu8LoginUI      = u8LoginUI;
            Pubvar.gu8userdata     = u8userdata;
            Pubvar.gdataimporttype = "";

            //填写状态栏信息
            toolStripStatusLabel.Text             = "已登陆";
            toolStripStatususeridtext.Text        = Pubvar.gu8userdata.UserId;
            toolStripStatuscompanytext.Text       = "[" + Pubvar.gu8userdata.AccID + "]" + Pubvar.gu8userdata.AccName;
            toolStripStatusoperationdatetext.Text = Pubvar.gu8userdata.operDate;

            //隐藏tab control 及标签页
            U8tabCtl.Visible           = false;
            U8dataimporttabPage.Parent = null;
        }
Esempio n. 7
0
        public static U8LoginInfor DoLogin(object login)
        {
            var _u8LoginCls = login as clsLogin;
            var loginnet    = new UFSoft.U8.Framework.Login.UI.clsLogin();
            var _userdata   = loginnet.GetLoginInfo(_u8LoginCls.userToken);

            return(new U8LoginInfor(login));
        }
Esempio n. 8
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
                LoginInfo = u8_login.GetLoginInfo();

                U8Login.clsLogin u8Login   = new U8Login.clsLogin();
                String           sSubId    = LoginInfo.cSubID;
                String           sAccID    = LoginInfo.AccID;
                String           sYear     = LoginInfo.iYear;
                String           sUser_ID  = txtUid.Text.Trim();
                String           sPassword = txtPwd.Text.Trim();
                String           sDate     = sLogDate;
                String           sServer   = LoginInfo.RightServer;
                String           sSerial   = "";
                if (u8Login.Login(ref sSubId, ref sAccID, ref sYear, ref sUser_ID, ref sPassword, ref sDate, ref sServer, ref sSerial))
                {
                    sUserID   = sUser_ID;
                    sUserName = LoginInfo.UserName;

                    string sSQL = @"
select a.cUser_Name ,b.cPsn_Name
from [UFSystem].[dbo].[UA_User] a inner join hr_hi_person b on a.cUser_Id = b.cPsn_Num
where a.cUser_Id = '{0}'
";
                    sSQL = string.Format(sSQL, sUser_ID);
                    DataTable dtPerson = DbHelperSQL.Query(sSQL);
                    if (dtPerson == null || dtPerson.Rows.Count == 0 || dtPerson.Rows[0]["cPsn_Name"].ToString().Trim() == "")
                    {
                        throw new Exception(sUser_ID + " is not plater");
                    }

                    txtUid.Enabled = false;
                    txtPwd.Enabled = false;

                    txtLotNo.Focus();

                    SetEnable(true);
                }
                else
                {
                    MessageBox.Show("The user does not exists or is logged out ,maybe password is incorrect!");

                    txtPwd.Text = "";

                    txtUid.Focus();
                    SetEnable(false);
                }
            }
            catch (Exception ee)
            {
                SetEnable(false);
                MessageBox.Show(ee.Message);
            }
        }
Esempio n. 9
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            bool bRight = false;

            if (sLogUserid.ToLower() == "demo")
            {
                bRight = true;
            }
            else
            {
                string    sSQL = "select * from _UserRight where UserID = '" + sLogUserid + "' and FormID = '1100'";
                DataTable dt   = DbHelperSQL.Query(sSQL);
                if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString().Trim() != "")
                {
                    bRight = true;
                }
            }

            if (!bRight)
            {
                throw new Exception("没有权限");
                //return null;
            }
            else
            {
                UserRight fm = new UserRight();

                fm.Conn      = conn;
                fm.sUserID   = sLogUserid;
                fm.sUserName = sLogUserName;
                fm.sLogDate  = sLogDate;



                this._Title = "插件权限设置";

                return(fm);
            }
        }
Esempio n. 10
0
        private void FrmIQCRMDF_Load(object sender, EventArgs e)
        {
            try
            {
                UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
                LoginInfo = u8login.GetLoginInfo();

                iqcrmdf1.txtUid.Text = LoginInfo.UserId;
                iqcrmdf1.txtPwd.Text = LoginInfo.Password;

                iqcrmdf1.btnLogin_Click(null, null);
                iqcrmdf1.GetCode(sCode);
            }
            catch (Exception ee)
            {
                FrmMsgBox frm = new FrmMsgBox();
                frm.richTextBox1.Text = ee.Message;
                frm.ShowDialog();
            }
        }
Esempio n. 11
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;

            产品现存量标签打印 fm = new 产品现存量标签打印();

            fm.Conn      = conn;
            fm.sUserID   = sLogUserid;
            fm.sUserName = sLogUserName;
            fm.sLogDate  = sLogDate;

            this._Title = "成品库标签打印";

            return(fm);
        }
Esempio n. 12
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            //if (DateTime.Today > Convert.ToDateTime("2018-1-5"))
            //{
            //    return null;
            //}

            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            //ClsUserRight clsUser = new ClsUserRight();
            //if (clsUser.chkRight(login, "TH_1"))
            //{
            ChkValue01 fm = new ChkValue01();

            fm.Conn      = conn;
            fm.sUserID   = sLogUserid;
            fm.sUserName = sLogUserName;
            fm.sLogDate  = sLogDate;
            fm.sAccID    = sAccID;
            //fm.log

            this._Title = "首检、巡检记录表";

            return(fm);
            //}
            //else
            //    return null;
        }
Esempio n. 13
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //显示U8门户登陆界面,处理用户登陆信息
            UFSoft.U8.Framework.Login.UI.clsLogin u8LoginUI = new UFSoft.U8.Framework.Login.UI.clsLogin();
            if (!u8LoginUI.login("DP"))
            {
                MessageBox.Show("登陆失败,原因:" + u8LoginUI.ErrDescript);
                u8LoginUI.ShutDown();
                return;
            }

            //从这个类里可以获取登陆信息、数据库连接信息等等
            UFSoft.U8.Framework.LoginContext.UserData u8userdata = new UFSoft.U8.Framework.LoginContext.UserData();
            u8userdata = u8LoginUI.GetLoginInfo();

            Pubvar.gu8LoginUI      = u8LoginUI;
            Pubvar.gu8userdata     = u8userdata;
            Pubvar.gdataimporttype = "";
            Application.Run(new MainForm());
        }
Esempio n. 14
0
        public bool chkRight(UFSoft.U8.Framework.Login.UI.clsLogin login, string sMenuID)
        {
            bool b = false;

            try
            {
                if (login.GetLoginInfo().UserId.ToLower() == "demo")
                {
                    return(true);
                }

                CalledContext Context = new CalledContext();
                Context.subId = "FA";
                Context.token = login.userToken;
                ModuleAuth auth = new ModuleAuth(Context);
                if (!auth.TaskExec(sMenuID, -1))
                {
                    if (auth.ErrNumber != 0)
                    {
                        throw new Exception(auth.ErrDescript);
                    }
                    else
                    {
                        throw new Exception("出现无法预知的错误,无法申请功能");
                    }
                }
                else
                {
                    b = true;
                }
            }
            catch (Exception ee)
            {
                throw new Exception(ee.Message);
            }
            return(b);
        }
Esempio n. 15
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            //ClsUserRight clsUser = new ClsUserRight();
            //if (clsUser.chkRight(login, "TH_5"))
            //{
            InvProcessPrice fm = new InvProcessPrice();

            fm.Conn      = conn;
            fm.sUserID   = sLogUserid;
            fm.sUserName = sLogUserName;
            fm.sLogDate  = sLogDate;
            fm.sAccID    = sAccID;
            //fm.log

            this._Title = "Workcenter Price";

            return(fm);
            //}
            //else
            //{
            //    MessageBox.Show("no rights");
            //    return null;
            //}
        }