示例#1
0
        public static LogPas GetLogPas(string login, int password)
        {
            LogPas  OnePassword;
            DataSet ds = TurAgentDLL.LogPas.GetLogPas(login, password);
            DataRow dr = ds.Tables["LogPas"].Rows[0];

            OnePassword = new LogPas(int.Parse(dr[0].ToString()), int.Parse(dr[1].ToString()), dr[2].ToString(), int.Parse(dr[3].ToString()));
            return(OnePassword);
        }
示例#2
0
        public static int CheckLogPas(string login, int pass)
        {
            LogPas  OnePassword;
            DataSet ds = TurAgentDLL.LogPas.GetLogPas(login, pass);

            if (ds.Tables[0].Rows.Count == 0)
            {
                return(0);
            }
            else
            {
                DataRow dr = ds.Tables["LogPas"].Rows[0];
                OnePassword = new LogPas(int.Parse(dr[0].ToString()), int.Parse(dr[1].ToString()), dr[2].ToString(), int.Parse(dr[3].ToString()));
                if (int.Parse(OnePassword.GetWorker) == 1)
                {
                    return(1);
                }
                else
                {
                    return(2);
                }
            }
        }