Beispiel #1
0
        /// <summary>
        /// 登陆U8系统确认身份,并得到登录字符串
        /// </summary>
        /// <param name="userID">用户名</param>
        /// <param name="password">密码</param>
        /// <param name="accID">帐套名</param>
        /// <param name="year">财务年度</param>
        /// <param name="inf">struct类型</param>
        /// <param name="customerName">登录者名字</param>
        /// <param name="connectionString">生成的数据库连接字符串</param>
        /// <param name="errMsg">错误信息</param>
        /// <returns>0:正确,非0,错误</returns>
        static public int Login(string userID, string password, string accID, string year, info inf,
            out string customerName, out string connectionString, out string errMsg)
        {

            customerName = "";
            connectionString = "";
            errMsg = "";
            string ERPService = "";     //ERP服务器地址
            string DBService = "";
            string sqlUser = "";
            string sqlPassword = "";

            try
            {
                sqlUser = inf.sqlUser;
                sqlPassword = inf.sqlPassword;
                ERPService = inf.ERPService; //string.Format("UFDATA_{0}_{1}",accID,year);//inf.ERPService;
                DBService = inf.DBService;

                connectionString = "user id=" + sqlUser + ";password="******";data source='" + DBService
                        + "';persist security info=True;initial catalog=UFDATA_" + accID + "_" + year
                        + ";Connection Timeout=30";
            }
            catch (Exception ex)
            {
                errMsg = "配置文件错误!" + ex.Message;
                return -1;
            }
            UFSoft.U8.Framework.Login.UI.clsLogin netLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();
            try
            {
                string SQL = "select top 1 cUser_Name from ufsystem..ua_user where cUser_id=N'" + userID + "' and cPassword='******'";
                DataSet Ds_User = new DataSet();
                int i = OperationSql.GetDataset(SQL, connectionString, out Ds_User, out errMsg);
                if (i != 0)
                {
                    return -2;
                }
                else
                {
                    if (Ds_User.Tables[0].Rows.Count == 0)
                    {
                        errMsg = "用户名或者密码错误";
                        return -2;
                    }
                    else
                    {
                        customerName = Ds_User.Tables[0].Rows[0][0].ToString();
                        return 0;
                    }
                }
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
                return -2;
            }
        }
        UFIDA.U8.Portal.Proxy.Actions.NetAction[] INetUserControl.CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login)
        {
            //UFIDA.U8.Portal.Proxy.Actions.NetAction[] actions = new NetAction[1];
            ////定义toolbar的处理事件

            //UserActionDelegate actionDelegate = new UserActionDelegate();

            //actions[0] = new NetAction("退出", new UserActionDelegate());
            //actions[0].ActionType = NetAction.NetActionType.Normal ;
            //actions[0].Text = "退出";

            return(null);
        }
Beispiel #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;

            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);
            }
        }
Beispiel #4
0
        public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login)
        {
            //IActionDelegate nsd = new NetSampleDelegate();
            ////string skey = "mynewcontrol";
            //NetAction[] aclist;
            //aclist = new NetAction[4];

            //NetAction ac = new NetAction("add", nsd);
            //ac.Text = "增加";
            //ac.Style = 1;
            //ac.SetGroup = "edit";
            ////设置组行数
            //ac.SetGroupRow = 1;
            ////设置图标大小,3最大
            //ac.RowSpan = 3;
            ////用间隔线隔开
            //ac.Catalog = "234";
            ////ac.Image = "返回.ico";
            //ac.Tag = usercontrol;
            ////ac.ActionType = UFIDA.U8.Portal.Proxy.Actions.NetAction.NetActionType(1);
            //aclist[0] = ac;

            //ac = new NetAction("query", nsd);
            //ac.Text = "查询";
            //ac.Style = 3;
            //ac.SetGroup = "edit1";
            //ac.Tag = usercontrol;
            //aclist[1] = ac;

            //ac = new NetAction("query2", nsd);
            //ac.Text = "查询2";
            //ac.SetGroup = "edit2";
            //ac.Tag = usercontrol;
            //aclist[2] = ac;

            //ac = new NetAction("query3", nsd);
            //ac.Text = "查询3";
            //ac.SetGroup = "edit3";
            //ac.Tag = usercontrol;
            //aclist[3] = ac;
            //return aclist;
            return(null);
            //throw new NotImplementedException();
        }
Beispiel #5
0
        public int RFLogin(string userCode, string passWord, string accID, string year, DateTime loginDateTime, string msgID, out string taskID,
                           out string loginString, out string dBstring, out string errMsg, out string loginUser, out DateTime systemDate, out bool isTaskExc, out bool isPFReport
                           )
        {
            Info baseinfo = new Info();

            baseinfo.ERPService = ConfigurationSettings.AppSettings.Get("ERPSERVER");
            baseinfo.subID      = subId;
            baseinfo.BarSubID   = subId;
            //baseinfo.ERPService = "127.0.0.1";
            //baseinfo.subID = "ST";
            //baseinfo.BarSubID = "ST";

            UFSoft.U8.Framework.Login.UI.clsLogin netLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();


            int val = CommonDAL.RFLogin(userCode, passWord, accID, year, msgID, loginDateTime, baseinfo, out loginString,
                                        out dBstring, out taskID, out errMsg, out loginUser, ref netLogin, out systemDate, out isTaskExc, out isPFReport);

            if (val == 0)
            {
                Application[taskID] = netLogin;
            }
            //U8Login.clsLogin u8Login = new U8Login.clsLogin();
            //u8Login.ConstructLogin(netLogin.userToken);
            //U8EnvContext envContext = new U8EnvContext();
            //envContext.U8Login = u8Login;

            #region 判断是否是演示期
            //bool isDemo = true;
            //if ((DateTime.Now - DateTime.Parse("2013-12-31")).Days > 0)
            //{
            //    isDemo = false;
            //}
            //if (isDemo == false)  //不在演示期范围内
            //{
            //    errMsg = "当前系统不在演示期范围内!";
            //    return -1;
            //}
            #endregion
            return(val);
        }
Beispiel #6
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="NewPwd">新密码</param>
        /// <param name="netLogin">界面登录字符串</param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public static int ChangePassword(string NewPwd, ref UFSoft.U8.Framework.Login.UI.clsLogin netLogin, out string errMsg)
        {
            errMsg = string.Empty;

            try
            {
                if (netLogin == null)
                {
                    errMsg = "登录字符串丢失!";
                    return(-1);
                }

                netLogin.ModifyUserPassword(NewPwd);
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
                return(-2);
            }
            return(0);
        }
Beispiel #7
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);
        }
Beispiel #8
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_2_01"))
            {
                if (DateTime.Now > Convert.ToDateTime("2020-5-20"))
                {
                    return(null);
                }

                IQCRMDF fm = new IQCRMDF(login);
                fm.Conn      = conn;
                fm.sUserID   = sLogUserid;
                fm.sUserName = sLogUserName;
                fm.sLogDate  = sLogDate;
                fm.sAccID    = sAccID;

                this._Title = "IQC";

                return(fm);
            }
            else
            {
                return(null);
            }
        }
Beispiel #9
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;
        }
Beispiel #10
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());
        }
Beispiel #11
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);
        }
Beispiel #12
0
        public int RFLogout(string taskID,
                            string userCode, string connectionString)
        {
            Info baseinfo = new Info();

            baseinfo.ERPService = "127.0.0.1";
            baseinfo.subID      = "CJ";
            baseinfo.BarSubID   = "CJ";
            //baseinfo.ERPService = "127.0.0.1";
            //baseinfo.subID = "ST";
            //baseinfo.BarSubID = "ST";
            UFSoft.U8.Framework.Login.UI.clsLogin netLogin = (UFSoft.U8.Framework.Login.UI.clsLogin)Application[taskID];
            string taskIDBarKey   = "Bar" + taskID;
            string taskIDConnKey  = "Conn" + taskID;
            string taskIDLoginKey = "Login" + taskID;

            object AdodbConn = Application[taskIDConnKey];

            U8Login.clsLogin login = Application[taskIDLoginKey] != null ? (U8Login.clsLogin)Application[taskIDLoginKey] : null;
            Application.Remove(taskIDBarKey);
            Application.Remove(taskIDConnKey);
            Application.Remove(taskIDLoginKey);
            return(CommonDAL.RFLogout(ref netLogin, AdodbConn, login, baseinfo, userCode, connectionString));
        }
Beispiel #13
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;
            //}
        }
Beispiel #14
0
        public static U8LoginInfor DoLogin(string cAccId, string cYear, string appServer, string dataSource,
                                           string sdate, string userid, string pass, string curlangid)
        {
            bool   bmerp = false;
            string subid = "AS";

            if (userid.Trim().Length == 0)
            {
                userid = "ASUSER";
                pass   = "******";
            }
            else
            {
                bmerp = true;
            }
            string serial    = "";
            string accid     = dataSource + "@" + cAccId;
            string year      = cYear;
            string appserver = appServer;

            if (sdate.Trim().Length == 0)
            {
                sdate = DateTime.Now.ToString("yyyy-MM-dd");
            }
            var login = new UFSoft.U8.Framework.Login.UI.clsLogin();

            if (curlangid.Length > 0)
            {
                login.LanguageID = curlangid;
            }
            if (login.login(subid, userid, pass, appserver, sdate, accid, serial))
            {
                #region 将login缓存到MERP中
                var token       = "";
                var xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(login.userToken);
                var doc       = xmlDocument.DocumentElement;
                var tokennode = doc.SelectSingleNode("/ufsoft/data/SignedToken");
                if (tokennode != null)
                {
                    token = tokennode.Attributes["id"].Value;
                }
                ContextObj context = new ContextObj();
                context.Login = login;
                ContextManager.SingletonInstance.Add(token, context);
                #endregion
                clsLogin _u8LoginCls = new clsLoginClass();
                _u8LoginCls.ConstructLogin(login.userToken);
                return(new U8LoginInfor(_u8LoginCls));
                //m_LoginCollection[hash] = login.userToken;
                //logger.Info(m_LoginCollection[hash].GetType().FullName);
                //_userdata = login.GetLoginInfo();
            }
            else
            {
                var sb = new StringBuilder();
                sb.AppendLine("登陆失败,错误信息:");
                sb.AppendLine("subid:" + subid);
                sb.AppendLine("accid:" + accid);
                sb.AppendLine("year:" + year);
                sb.AppendLine("userid:" + userid);
                sb.AppendLine("pass:"******"sdate:" + sdate);
                sb.AppendLine("appserver:" + appserver);
                sb.AppendLine("serial:" + serial);
                sb.AppendLine("login.ErrDescript:" + login.ErrDescript);
                throw new Exception(sb.ToString());
            }
        }
Beispiel #15
0
        public string LoginTest(string userCode, string passWord, string accID, string year, DateTime loginDateTime, string msgID)
        {
            string res;

            string   taskID;
            string   loginString;
            string   dBstring;
            string   errMsg;
            string   loginUser;
            DateTime systemDate;
            bool     isTaskExc;
            bool     isPFReport;


            Info baseinfo = new Info();

            baseinfo.ERPService = ConfigurationSettings.AppSettings.Get("ERPSERVER");
            baseinfo.subID      = subId;
            baseinfo.BarSubID   = subId;
            //baseinfo.ERPService = "127.0.0.1";
            //baseinfo.subID = "ST";
            //baseinfo.BarSubID = "ST";

            UFSoft.U8.Framework.Login.UI.clsLogin netLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();


            int val = CommonDAL.RFLogin(userCode, passWord, accID, year, msgID, loginDateTime, baseinfo, out loginString,
                                        out dBstring, out taskID, out errMsg, out loginUser, ref netLogin, out systemDate, out isTaskExc, out isPFReport);

            if (val == 0)
            {
                Application[taskID] = netLogin;
            }
            //U8Login.clsLogin u8Login = new U8Login.clsLogin();
            //u8Login.ConstructLogin(netLogin.userToken);
            //U8EnvContext envContext = new U8EnvContext();
            //envContext.U8Login = u8Login;

            #region 判断是否是演示期
            //bool isDemo = true;
            //if ((DateTime.Now - DateTime.Parse("2013-12-31")).Days > 0)
            //{
            //    isDemo = false;
            //}
            //if (isDemo == false)  //不在演示期范围内
            //{
            //    errMsg = "当前系统不在演示期范围内!";
            //    return -1;
            //}

            #endregion

            res  = "{\"retcode\":" + val + ",";
            res += "\"taskID\":\"" + taskID + "\",";
            res += "\"loginString\":\"" + loginString + "\",";
            res += "\"dBstring\",\"" + dBstring + "\"";
            res += "\"errMsg\",\"" + errMsg + "\"";
            res += "\"loginUser\",\"" + loginUser + "\"";
            res += "\"systemDate\",\"" + systemDate.ToString("yyyy-MM-dd hh:mm:ss") + "\"";
            res += "\"isTaskExc\",\"" + (isTaskExc ? "1" : "0") + "\"";
            res += "\"isPFReport\",\"" + (isPFReport ? "1" : "0") + "\"";
            res += "}";
            return(res);
        }
Beispiel #16
0
        public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login)
        {
            IActionDelegate nsd = new NetSampleDelegate();
            ////string skey = "mynewcontrol";
            NetAction ac = new NetAction("add", nsd);

            NetAction[] aclist;
            aclist          = new NetAction[11];
            ac.Text         = "增行";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.add;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "增行";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[0]       = ac;

            ac = new NetAction("del", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "删行";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Adjust_write_off;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "删行";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[1]       = ac;



            ac = new NetAction("save", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "保存";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Confirm;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "保存";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[2]       = ac;

            ac = new NetAction("xunjia", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "询价";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.approval_query;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "询价";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[3]       = ac;



            ac = new NetAction("guanbi", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "关闭";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Cancel;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "关闭";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[4]       = ac;

            ac = new NetAction("dakai", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "打开";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.open;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "打开";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[5]       = ac;


            ac = new NetAction("liancha", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "联查询价单";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.cost;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "联查询价单";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[6]       = ac;
            //return aclist;



            ac = new NetAction("query", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "查询";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.filter;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "查询";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[7]       = ac;



            ac = new NetAction("save2", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "报价保存";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Confirm;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "报价保存";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[10]      = ac;


            ac = new NetAction("savebuju", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "保存布局";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "保存布局";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 1;
            aclist[8]       = ac;

            ac = new NetAction("delbuju", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "删除布局";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "保存布局";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 1;
            aclist[9]       = ac;
            return(aclist);
            ////return null;
        }
        public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login)
        {
            IActionDelegate nsd = new NetSampleDelegate();

            ////string skey = "mynewcontrol";

            NetAction[] aclist;
            aclist = new NetAction[12];
            NetAction ac = new NetAction("add", nsd);

            ac.Text         = "增行";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.add;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "增行";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[0]       = ac;

            ac = new NetAction("del", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "删行";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Adjust_write_off;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "删行";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[1]       = ac;



            ac              = new NetAction("add", nsd);
            ac.Text         = "批量添加";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.add;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "添加";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            ac.IsVisible    = false;
            aclist[2]       = ac;

            ac = new NetAction("Save", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "保存";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.save;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "保存";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[3]       = ac;

            ac = new NetAction("query", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "查询";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.query;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "查询";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[4]       = ac;

            ac = new NetAction("Checkall", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "全选/全消";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Select_all;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "审核";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            //ac.IsVisible = false;
            aclist[5] = ac;


            ac = new NetAction("ShenHe", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "审核";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Cancel;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "审核";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            //ac.IsVisible = false;
            aclist[6] = ac;

            ac = new NetAction("QiShen", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "弃审";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.open;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "弃审";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            //ac.IsVisible = false;
            aclist[7] = ac;

            ac = new NetAction("Excel", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "导出EXCEL";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.transfer;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "查询";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            //ac.IsVisible = false;
            aclist[8] = ac;

            ac = new NetAction("ExcelIn", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "导入数据";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "查询";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            ac.IsVisible    = false;
            aclist[9]       = ac;


            ac = new NetAction("savebuju", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "保存布局";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "保存布局";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 1;
            aclist[10]      = ac;

            ac = new NetAction("delbuju", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "删除布局";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "保存布局";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 1;
            aclist[11]      = ac;

            return(aclist);
            ////return null;
        }
Beispiel #18
0
        public OQCRMDFList(UFSoft.U8.Framework.Login.UI.clsLogin login)
        {
            InitializeComponent();

            u8_login = login;
        }
Beispiel #19
0
        /// <summary>

        /// 时间:2010-09-01
        /// </summary>
        /// <param name="userCode">用户编码</param>
        /// <param name="password">密码</param>
        /// <param name="accid">帐套号</param>
        /// <param name="year">帐套年度</param>
        /// <param name="msgID"></param>
        /// <param name="loginTime">登入时间</param>
        /// <param name="inf"></param>
        /// <param name="loginString">登入字符串</param>
        /// <param name="dBString">数据库字符串</param>
        /// <param name="taskId">任务ID</param>
        /// <param name="errMsg">错误信息</param>
        /// <param name="loginUser">登入人</param>
        /// <param name="netLogin"></param>
        /// <param name="systemDate">系统时间</param>
        /// <param name="isTaskExc">上下岗时间权限</param>
        /// <param name="isPFReport">工序流转卡权限</param>
        /// <returns></returns>
        public static int RFLogin(string userCode, string password, string accid, string year, string msgID, DateTime loginTime, Info inf,
                                  out string loginString, out string dBString, out string taskId, out string errMsg,
                                  out string loginUser, ref UFSoft.U8.Framework.Login.UI.clsLogin netLogin
                                  , out DateTime systemDate, out bool isTaskExc, out bool isPFReport)
        {
            loginString = "";
            taskId      = "";
            loginUser   = "";
            dBString    = "";
            errMsg      = "";
            isTaskExc   = false;     //记录当前登录人员是否有修改上下岗时间的权限

            isPFReport = false;      //记录当前登录人员是否有工序流转卡完工单权限

            string ERPService  = ""; //ERP服务器地址
            string DBService   = "";
            bool   result      = false;
            string sqlUser     = "";
            string sqlPassword = "";

            systemDate = loginTime;

            string serID = msgID + "@0";     //创建加密序列号


            //string serID = "{" + Guid.NewGuid() + "}" + msgID + "@0";


            string pDate = loginTime.ToString("yyyy-MM-dd");

            try
            {
                ERPService = inf.ERPService;
                DBService  = inf.DBService;
            }
            catch (Exception ex)
            {
                errMsg = "配置文件错误" + ex.Message;
                return(-1);
            }
            U8Login.clsLoginClass login;    //创建登录对象
            netLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();


            try
            {
                result = netLogin.login("DP", userCode, password, inf.ERPService, pDate, accid, serID, false); //先登录平台

                if (result)
                {
                    netLogin.WorkStationName = userCode + ":" + msgID;//ADD BY HQ 设置工作站名称

                    //netLogin.SubLogin("CJ");                              //加密服务登录用户站点 + 1

                    UFSoft.U8.Framework.LoginContext.ProductContext pcT = new UFSoft.U8.Framework.LoginContext.ProductContext();
                    pcT = netLogin.SubLogin(inf.subID);                        //加密服务登录用户站点 + 1

                    if (pcT == null)
                    {
                        errMsg = "【" + _productName + "】登录错误:" + netLogin.ErrDescript;
                        return(1);
                    }
                    taskId = netLogin.GetTaskID(inf.BarSubID);              //获得任务号
                }
                else
                {
                    errMsg = "【" + _productName + "】登录错误:" + netLogin.ErrDescript;
                    return(1);
                }

                login = new U8Login.clsLoginClass();                    //生成登录对象

                result = login.ConstructLogin(netLogin.userToken);
                result = login.Login(ref inf.BarSubID, ref accid, ref year, ref userCode, ref password, ref pDate, ref inf.ERPService, ref serID);
                if (result)
                {
                    object bDemo = false;

                    //bDemo = true; //正式版
                    //bDemo = False;    演示版


                    login.GetAccInfo(10000, ref bDemo);//判断产品是否演示版


                    isTaskExc  = true; //= login.TaskExec("FZ102013", 1, 1);             //获得上下岗时间修改权限 by zhaobo
                    isPFReport = true; // = login.TaskExec("FC06006N", 1, 1);             //获得工序流转卡权限  By zhaobo


                    if (taskId == "")
                    {
                        errMsg = "";
                    }
                    //不是演示版


                    loginUser   = login.cUserName.ToString();
                    loginString = netLogin.userToken.ToString();


                    string dataSource, catalog;
                    SplitUserID(login.UfDbName, 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;

                    string tempdBstring = "user id=" + sqlUser + ";password="******";data source=" + dataSource
                                          + ";persist security info=True;initial catalog=UFSystem";
                    dBString = dBString + "|" + login.UfDbName;

                    IniU8Message(tempdBstring);

                    if (!Convert.ToBoolean(bDemo))
                    {
                        if (isDemoOver(dBString))
                        {
                            errMsg = "请购买用友U8【" + _productName + "】";
                            return(5);
                        }
                    }


                    return(0);
                }
                else
                {
                    errMsg = "错误:" + login.ShareString;
                    //
                    return(2);
                }
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
                return(-2);
            }

            // return 0;
        }
Beispiel #20
0
        /// <summary>
        /// 获取 vb login 和 .net login
        /// 可绕过login验证
        /// </summary>
        /// <param name="bd"></param>
        /// <param name="oSysLogin"></param>
        /// <param name="u8Login"></param>
        /// <returns></returns>
        private Model.DealResult GetU8LoginNew(Model.APIData bd, UFSoft.U8.Framework.Login.UI.clsLogin oSysLogin, U8Login.clsLogin u8Login)
        {
            Model.DealResult dr = new Model.DealResult();

            System.Diagnostics.Trace.WriteLine("  before  GetU8Login 判断格式 ");
            #region 判断格式  登录
            string strErr = ",请在[账套档案注册]模块中更新!";
            if (string.IsNullOrEmpty(bd.ConnectInfo.UserId))
            {
                dr.ResultMsg = "默认操作员不能为空" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }
            if (string.IsNullOrEmpty(bd.ConnectInfo.Source))
            {
                dr.ResultMsg = "数据源不能为空" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }
            if (string.IsNullOrEmpty(bd.ConnectInfo.AccId))
            {
                dr.ResultMsg = "账套号不能为空" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }
            if (string.IsNullOrEmpty(bd.ConnectInfo.Srv))
            {
                dr.ResultMsg = "服务器地址不能为空" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }
            if (string.IsNullOrEmpty(bd.ConnectInfo.YearId))
            {
                dr.ResultMsg = "登陆年度不能为空" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }
            else
            {
                try { int.Parse(bd.ConnectInfo.YearId); }
                catch
                {
                    dr.ResultMsg = "登陆年度格式错误:" + bd.ConnectInfo.YearId + strErr;
                    dr.ResultNum = -1;
                    Marshal.FinalReleaseComObject(u8Login);
                    throw new Exception(dr.ResultMsg);
                }
            }
            DbHelperSQLP dsp    = new DbHelperSQLP(bd.ConnectInfo.Constring);
            string       strSql = "SELECT 1 FROM UFSystem.dbo.UA_AccountDatabase A JOIN UFSystem.dbo.UA_Account B ON A.cAcc_Id=B.cAcc_Id WHERE A.cAcc_Id='" + bd.ConnectInfo.AccId + "' ";
            if (!dsp.Exists(strSql))
            {
                dr.ResultMsg = "登陆失败,原因:账套 " + bd.ConnectInfo.AccId + " 在 " + bd.ConnectInfo.Srv + " 上不存在";
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }
            #endregion

            System.Diagnostics.Trace.WriteLine("  after  GetU8Login 判断格式 ");


            bool   bLogined;
            string beginDate;

            oSysLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();

            beginDate            = "";      //GetMonthBegindate(acc_ID, iYear, "12")  //用12期间构造login,12期间必有
            oSysLogin.LanguageID = "zh-CN"; // GetAccountLoginLocaleID(modUtility.GetDbName(acc_ID, iYear))

            string subId    = U8.Interface.Bus.SysInfo.subId;
            string userId   = bd.ConnectInfo.UserId;
            string accId    = bd.ConnectInfo.Source + "@" + bd.ConnectInfo.AccId;
            string yearId   = bd.ConnectInfo.YearId;
            string password = bd.ConnectInfo.Password;
            string date     = bd.ConnectInfo.Date;
            string srv      = bd.ConnectInfo.sSrv;
            string serial   = bd.ConnectInfo.Serial;

            bLogined = oSysLogin.login(subId, userId, password, srv, date, accId, serial);

            if (!bLogined)
            {
                strErr = oSysLogin.ErrDescript; //& g_fmtr.GetString("String.U8.AA.Admin.4671", g_args)
                //'strErr = oSysLogin.ErrDescript & "内置用户密码不正确!"
                //'Call WriteTransferLog(g_ologin.cAcc_ID, g_ologin.cAccName, g_ologin.cIyear, "", "准备年结环境时出现错误,错误描述:" & oSyslogin.ErrDescript & "内置用户密码不正确!")
                dr.ResultMsg = "登陆失败,原因:" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }

            UFSoft.U8.Framework.LoginContext.ProductContext oLoginContext;
            oLoginContext = new UFSoft.U8.Framework.LoginContext.ProductContext();
            oLoginContext = oSysLogin.SubLogin(U8.Interface.Bus.SysInfo.subId);

            if (null == oLoginContext)
            {
                strErr = oSysLogin.ErrDescript;
                //'MsgBox oSyslogin.ErrDescript
                //'Call WriteTransferLog(g_ologin.cAcc_ID, g_ologin.cAccName, g_ologin.cIyear, "", "准备年结环境时出现错误,错误描述:" & oSyslogin.ErrDescript)
                dr.ResultMsg = "登陆失败,原因:" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }

            //u8Login = new U8Login.clsLogin();

            if (!u8Login.ConstructLogin(oSysLogin.userToken))
            {
                strErr = u8Login.ShareString;
                //'Call WriteTransferLog(g_ologin.cAcc_ID, g_ologin.cAccName, g_ologin.cIyear, "", "准备年结环境时出现错误,错误描述:" & oLogin.ShareString)
                dr.ResultMsg = "登陆失败,原因:" + strErr;
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }

            if (!u8Login.Login(ref subId, ref accId, ref yearId, ref userId, ref password, ref date, ref srv, ref serial))
            {
                System.Diagnostics.Trace.WriteLine("    GetU8Login  failed  ");
                dr.ResultMsg = "登陆失败,原因:" + u8Login.ShareString;
                if (u8Login.ShareString.IndexOf("年度") > 0 || u8Login.ShareString.IndexOf("日期") > 0)
                {
                    dr.ResultMsg += " - " + date;
                }
                dr.ResultNum = -1;
                Marshal.FinalReleaseComObject(u8Login);
                throw new Exception(dr.ResultMsg);
            }


            return(dr);
        }
Beispiel #21
0
        public bool UserLogin(ref UserInfo user, ref string strError)
        {
            if (DateTime.Today >= Convert.ToDateTime("2016-10-15") && !securityAndRegister.EncryptionHelper.CheckRegist())
            {
                strError = "登陆异常!该用户不存在";
                return(false);
            }
            if (string.IsNullOrEmpty(user.LoginDevice))
            {
                user.LoginDevice = user.LoginIP;
            }
            string   LoginIP = user.LoginIP;
            DateTime CurrentTime;
            string   strSql = string.Empty;

            if (user.UserNo.ToUpper() != "ADMIN")
            {
                UFSoft.U8.Framework.Login.UI.clsLogin netLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();
                user.Password = netLogin.EnPassWord(user.Password);
                strSql        = string.Format("SELECT GETDATE() CurrentTime,V_User.* FROM V_User WHERE UserNo = '{0}' AND password = '******'", user.UserNo, user.Password);
            }
            else
            {
                strSql = string.Format("SELECT GETDATE() CurrentTime,V_User.* FROM V_User WHERE UserNo = '{0}' ", user.UserNo);
            }
            //strSql = string.Format("SELECT GETDATE() CurrentTime,V_User.* FROM V_User WHERE UserNo = '{0}'", user.UserNo);

            UserInfo model;

            using (SqlDataReader odr = OperationSql.ExecuteReader(CommandType.Text, strSql))
            {
                if (odr.Read())
                {
                    User_Func func = new User_Func();
                    model       = func.GetModelFromDataReader(odr);
                    CurrentTime = odr["CurrentTime"].ToDateTime();

                    if (model == null)
                    {
                        strError = "用户实例化失败";
                        return(false);
                    }
                    else if (model.UserStatus == 2)
                    {
                        strError = string.Format("用户【{0}】已停用", model.UserName);
                        return(false);
                    }
                    else if (model.IsDel == 2)
                    {
                        strError = string.Format("用户【{0}】已删除", model.UserName);
                        return(false);
                    }

                    if (model.BIsOnline)
                    {
                        if (model.UserType == 1)
                        {
                            if (!string.IsNullOrEmpty(user.LoginIP) && model.LoginIP.Length + user.LoginIP.Length >= 100 && model.LoginIP.IndexOf(user.LoginIP) <= -1)
                            {
                                strError = string.Format("超级管理员用户【{0}】已超过登录次数上限,目前共【{1}】处登录{2}请先登出或联系管理员清除后重试", model.UserName, model.LoginIP.Split(';').Length, Environment.NewLine);
                                return(false);
                            }
                            else if (!string.IsNullOrEmpty(user.LoginDevice) && model.LoginDevice.Length + user.LoginDevice.Length >= 200 && model.LoginDevice.IndexOf(user.LoginDevice) <= -1)
                            {
                                strError = string.Format("超级管理员用户【{0}】已超过登录次数上限,目前共【{1}】处登录{2}请先登出或联系管理员清除后重试", model.UserName, model.LoginDevice.Split(';').Length, Environment.NewLine);
                                return(false);
                            }
                        }
                        else
                        {
                            if (model.LoginIP != user.LoginIP)
                            {
                                string LoginAddress = string.IsNullOrEmpty(model.LoginDevice) ? model.LoginIP : model.LoginDevice;
                                if (!model.LoginIP.StartsWith("PC"))
                                {
                                    strError = string.Format("用户【{0}】已于【{1}】在【{2}】处登录{3}请先登出或联系管理员清除后重试", model.UserName, model.LoginTime, LoginAddress, Environment.NewLine);
                                    return(false);
                                }
                                else if ((CurrentTime - model.LoginTime.ToDateTime()).TotalMilliseconds < 1500000)
                                {
                                    strError = string.Format("用户【{0}】正在【{1}】处使用{2}请先登出或联系管理员清除后重试", model.UserName, LoginAddress, Environment.NewLine);
                                    return(false);
                                }
                            }
                        }
                    }

                    model.LoginTime   = CurrentTime;
                    model.LoginIP     = user.LoginIP;
                    model.LoginDevice = user.LoginDevice;

                    user = model;
                }
                else
                {
                    strSql = string.Format("SELECT COUNT(1) FROM V_User WHERE UserNo = '{0}' ", user.UserNo);
                    int i = OperationSql.ExecuteScalar(CommandType.Text, strSql).ToInt32();
                    if (i <= 0)
                    {
                        strError = "登陆异常!该用户不存在";
                        return(false);
                    }
                    else
                    {
                        strError = "密码输入错误";
                        return(false);
                    }
                }
            }

            return(true);
        }
Beispiel #22
0
        public UFIDA.U8.Portal.Proxy.Actions.NetAction[] CreateToolbar(UFSoft.U8.Framework.Login.UI.clsLogin login)
        {
            IActionDelegate nsd = new NetSampleDelegate();

            ////string skey = "mynewcontrol";

            NetAction[] aclist;
            aclist = new NetAction[11];

            NetAction ac = new NetAction("query", nsd);

            //aclist = new NetAction[1];
            ac.Text         = "查询";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.filter;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "查询";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[0]       = ac;



            ac              = new NetAction("gengxin", nsd);
            ac.Text         = "新增批记录";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.add;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "手动更新";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            aclist[1]       = ac;

            ac              = new NetAction("daochu", nsd);
            ac.Text         = "日志记录";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Increment;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "重新导入";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            //ac.IsVisible = false;
            aclist[2] = ac;


            ac              = new NetAction("daoru", nsd);
            ac.Text         = "重新导入U8";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Add_a_row;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "重新导入";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            ac.IsVisible    = false;
            aclist[3]       = ac;

            ac = new NetAction("del", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "标记删除";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Adjust_write_off;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "删行";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            //ac.IsVisible = false;
            ac.IsVisible = false;
            aclist[4]    = ac;


            ac = new NetAction("ShenHe", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "更新锁定状态";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Approve_all;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "审核";
            ac.SetGroupRow  = 1;
            ac.IsVisible    = true;
            ac.RowSpan      = 3;
            ac.IsVisible    = false;
            aclist[5]       = ac;



            ac = new NetAction("Checkall", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "全选/全消";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.Select_all;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "审核";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            ac.IsVisible    = false;
            aclist[6]       = ac;



            ac = new NetAction("Excel", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "导出Excel";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "查询";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            //ac.IsVisible = false;
            aclist[7] = ac;

            ac = new NetAction("PrintMo", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "打印";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.print;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "打印";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 3;
            ac.IsVisible    = false;
            //ac.IsHaveAuth = true;
            aclist[8] = ac;


            ac = new NetAction("savebuju", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "保存布局";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            //ac.SetGroup = "保存布局";
            //ac.SetGroupRow = 1;
            //ac.RowSpan = 1;
            //ac.IsVisible = false;
            aclist[9] = ac;

            ac = new NetAction("delbuju", nsd);
            //aclist = new NetAction[1];
            ac.Text         = "删除布局";
            ac.Tag          = usercontrol;
            ac.Image        = Properties.Resources.import;
            ac.ActionType   = NetAction.NetActionType.Edit;
            ac.DisplayStyle = 1;
            ac.Style        = 1;
            ac.SetGroup     = "保存布局";
            ac.SetGroupRow  = 1;
            ac.RowSpan      = 1;
            aclist[10]      = ac;
            //ac.IsVisible = false;
            return(aclist);
            //return null;
        }