Esempio n. 1
0
        public List <FullCardInfo> GetProcessData(string userName, string step)
        {
            NpgsqlParameter paramUserName = new NpgsqlParameter("@user_name", NpgsqlTypes.NpgsqlDbType.Text);

            paramUserName.Value = userName;
            NpgsqlParameter paramstep = new NpgsqlParameter("@step", NpgsqlTypes.NpgsqlDbType.Text);

            paramstep.Value = step;
            List <FullCardInfo> dt = cmd.ExecuteDataAdapter <FullCardInfo>(DBConstant.GetDataStep, new NpgsqlParameter[] { paramUserName, paramstep });

            return(dt);
        }
        public List <ConfigurationItem> GetAllConfig()
        {
            List <ConfigurationItem> result = null;

            result = cmd.ExecuteDataAdapter <ConfigurationItem>(DBConstant.GetAllConfig, null);
            return(result);
        }
Esempio n. 3
0
        public User DoLogin(string userName, string password)
        {
            User            result        = null;
            NpgsqlParameter paramUserName = new NpgsqlParameter("@login_username", NpgsqlTypes.NpgsqlDbType.Text);

            paramUserName.Value = userName;
            NpgsqlParameter paramPassword = new NpgsqlParameter("@login_password", NpgsqlTypes.NpgsqlDbType.Text);

            paramPassword.Value = password;
            List <User> lstUser = cmd.ExecuteDataAdapter <User>(DBConstant.GetUserInfo, new NpgsqlParameter[] { paramUserName, paramPassword });

            if (lstUser != null && lstUser.Count > 0)
            {
                result = lstUser.FirstOrDefault();
            }
            return(result);
        }
Esempio n. 4
0
        public List <Data> GetAllData(string session)
        {
            NpgsqlParameter param = new NpgsqlParameter("@sessionName", NpgsqlTypes.NpgsqlDbType.Text);

            param.Value = session;
            List <Data> dt = cmd.ExecuteDataAdapter <Data>(DBConstant.GetAllData, new NpgsqlParameter[] { param });

            return(dt);
        }
Esempio n. 5
0
        public WorkingStatus GetWorkingStatus(string username, string step)
        {
            NpgsqlParameter paramUser = new NpgsqlParameter("@userName", NpgsqlTypes.NpgsqlDbType.Text);

            paramUser.Value = username;
            NpgsqlParameter paramStep = new NpgsqlParameter("@userstep", NpgsqlTypes.NpgsqlDbType.Text);

            paramStep.Value = step;
            List <WorkingStatus> dt = cmd.ExecuteDataAdapter <WorkingStatus>(DBConstant.GetWorkingStatus, new NpgsqlParameter[] { paramUser, paramStep });

            if (dt != null && dt.Count > 0)
            {
                return(dt.FirstOrDefault());
            }
            return(null);
        }