Exemplo n.º 1
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.Organize> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.Organize> List = new List <BizProcess.Data.Model.Organize>();

            BizProcess.Data.Model.Organize model = null;
            while (dataReader.Read())
            {
                model              = new BizProcess.Data.Model.Organize();
                model.ID           = dataReader.GetGuid(0);
                model.Name         = dataReader.GetString(1);
                model.Number       = dataReader.GetString(2);
                model.Type         = dataReader.GetInt32(3);
                model.Status       = dataReader.GetInt32(4);
                model.ParentID     = dataReader.GetGuid(5);
                model.Sort         = dataReader.GetInt32(6);
                model.Depth        = dataReader.GetInt32(7);
                model.ChildsLength = dataReader.GetInt32(8);
                if (!dataReader.IsDBNull(9))
                {
                    model.ChargeLeader = dataReader.GetString(9);
                }
                if (!dataReader.IsDBNull(10))
                {
                    model.Leader = dataReader.GetString(10);
                }
                if (!dataReader.IsDBNull(11))
                {
                    model.Note = dataReader.GetString(11);
                }
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.DBExtract> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.DBExtract> List = new List <BizProcess.Data.Model.DBExtract>();

            BizProcess.Data.Model.DBExtract model = null;
            while (dataReader.Read())
            {
                model      = new BizProcess.Data.Model.DBExtract();
                model.ID   = dataReader.GetGuid(0);
                model.Name = dataReader.GetString(1);
                if (!dataReader.IsDBNull(2))
                {
                    model.Comment = dataReader.GetString(2);
                }
                if (!dataReader.IsDBNull(3))
                {
                    model.DBConnID = dataReader.GetGuid(3);
                }
                if (!dataReader.IsDBNull(4))
                {
                    model.DesignJSON = dataReader.GetString(4);
                }
                model.ExtractType = dataReader.GetBoolean(5);
                if (!dataReader.IsDBNull(6))
                {
                    model.RunTime = dataReader.GetString(6);
                }
                model.OnlyIncrement = dataReader.GetBoolean(7);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <Data.Model.ReportTemplate> DataReaderToList(MySqlDataReader dataReader)
        {
            List <Data.Model.ReportTemplate> List = new List <Data.Model.ReportTemplate>();

            Data.Model.ReportTemplate model = null;
            while (dataReader.Read())
            {
                model       = new Data.Model.ReportTemplate();
                model.ID    = dataReader.GetGuid(0);
                model.Title = dataReader.GetString(1);
                model.Type  = dataReader.GetGuid(2);
                if (!dataReader.IsDBNull(3))
                {
                    model.Html = dataReader.GetString(3);
                }
                if (!dataReader.IsDBNull(4))
                {
                    model.DesignJSON = dataReader.GetString(4);
                }
                if (!dataReader.IsDBNull(5))
                {
                    model.UseMember = dataReader.GetString(5);
                }
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.WorkFlowDelegation> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.WorkFlowDelegation> List = new List <BizProcess.Data.Model.WorkFlowDelegation>();

            BizProcess.Data.Model.WorkFlowDelegation model = null;
            while (dataReader.Read())
            {
                model           = new BizProcess.Data.Model.WorkFlowDelegation();
                model.ID        = dataReader.GetGuid(0);
                model.UserID    = dataReader.GetGuid(1);
                model.StartTime = dataReader.GetDateTime(2);
                model.EndTime   = dataReader.GetDateTime(3);
                if (!dataReader.IsDBNull(4))
                {
                    model.FlowID = dataReader.GetGuid(4);
                }
                model.ToUserID  = dataReader.GetGuid(5);
                model.WriteTime = dataReader.GetDateTime(6);
                if (!dataReader.IsDBNull(7))
                {
                    model.Note = dataReader.GetString(7);
                }
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.Dictionary> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.Dictionary> List = new List <BizProcess.Data.Model.Dictionary>();

            BizProcess.Data.Model.Dictionary model = null;
            while (dataReader.Read())
            {
                model          = new BizProcess.Data.Model.Dictionary();
                model.ID       = dataReader.GetGuid(0);
                model.ParentID = dataReader.GetGuid(1);
                model.Title    = dataReader.GetString(2);
                if (!dataReader.IsDBNull(3))
                {
                    model.Code = dataReader.GetString(3);
                }
                if (!dataReader.IsDBNull(4))
                {
                    model.Value = dataReader.GetString(4);
                }
                if (!dataReader.IsDBNull(5))
                {
                    model.Note = dataReader.GetString(5);
                }
                if (!dataReader.IsDBNull(6))
                {
                    model.Other = dataReader.GetString(6);
                }
                model.Sort = dataReader.GetInt32(7);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.RoleApp> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.RoleApp> List = new List <BizProcess.Data.Model.RoleApp>();

            BizProcess.Data.Model.RoleApp model = null;
            while (dataReader.Read())
            {
                model          = new BizProcess.Data.Model.RoleApp();
                model.ID       = dataReader.GetGuid(0);
                model.ParentID = dataReader.GetGuid(1);
                model.RoleID   = dataReader.GetGuid(2);
                if (!dataReader.IsDBNull(3))
                {
                    model.AppID = dataReader.GetGuid(3);
                }
                model.Title = dataReader.GetString(4);
                if (!dataReader.IsDBNull(5))
                {
                    model.Params = dataReader.GetString(5);
                }
                model.Sort = dataReader.GetInt32(6);
                if (!dataReader.IsDBNull(7))
                {
                    model.Ico = dataReader.GetString(7);
                }
                model.Type = dataReader.GetInt32(8);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 7
0
        public List <NbaPlayer> GetPlayers(Guid gameId, string side)
        {
            // Allowable values of parameter side are "home" or "away"

            List <NbaPlayer> playerList = new List <NbaPlayer>();

            using (MySqlConnection mySqlConnection = MySqlConnection)
            {
                mySqlConnection.Open();
                const string storedProcedure = "pbp.GetPlayers";

                using (MySqlCommand mySqlCommand = new MySqlCommand(storedProcedure, mySqlConnection))
                {
                    mySqlCommand.CommandType = CommandType.StoredProcedure;

                    MySqlParameter mySqlParameter1 = new MySqlParameter(nameof(gameId), gameId);
                    mySqlCommand.Parameters.Add(mySqlParameter1);

                    MySqlParameter mySqlParameter2 = new MySqlParameter(nameof(side), side);
                    mySqlCommand.Parameters.Add(mySqlParameter2);

                    using (MySqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader())
                    {
                        if (!mySqlDataReader.HasRows)
                        {
                            const string error   = "GetPlayers() has no rows";
                            string       message = $"{error,50}: {storedProcedure,40}, {gameId,40}, {side}\n";
                            Write(message);

                            return(playerList);
                        }

                        int playerNumber = 1;

                        while (mySqlDataReader.Read())
                        {
                            NbaPlayer nbaPlayer = new NbaPlayer
                            {
                                GameId       = mySqlDataReader.GetGuid("game_id"),
                                PlayerId     = mySqlDataReader.GetGuid("player_id"),
                                FullName     = mySqlDataReader.GetString("full_name"),
                                JerseyNumber = mySqlDataReader.GetInt32("jersey"),
                                TeamId       = mySqlDataReader.GetGuid("team_id"),
                                Side         = side,
                                Number       = playerNumber
                            };

                            playerNumber++;
                            playerList.Add(nbaPlayer);
                        }

                        return(playerList);
                    }
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.WorkFlowTask> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.WorkFlowTask> List = new List <BizProcess.Data.Model.WorkFlowTask>();

            BizProcess.Data.Model.WorkFlowTask model = null;
            while (dataReader.Read())
            {
                model             = new BizProcess.Data.Model.WorkFlowTask();
                model.ID          = dataReader.GetGuid(0);
                model.PrevID      = dataReader.GetGuid(1);
                model.PrevStepID  = dataReader.GetGuid(2);
                model.FlowID      = dataReader.GetGuid(3);
                model.StepID      = dataReader.GetGuid(4);
                model.StepName    = dataReader.GetString(5);
                model.InstanceID  = dataReader.GetString(6);
                model.GroupID     = dataReader.GetGuid(7);
                model.Type        = dataReader.GetInt32(8);
                model.Title       = dataReader.GetString(9);
                model.SenderID    = dataReader.GetGuid(10);
                model.SenderName  = dataReader.GetString(11);
                model.SenderTime  = dataReader.GetDateTime(12);
                model.ReceiveID   = dataReader.GetGuid(13);
                model.ReceiveName = dataReader.GetString(14);
                model.ReceiveTime = dataReader.GetDateTime(15);
                if (!dataReader.IsDBNull(16))
                {
                    model.OpenTime = dataReader.GetDateTime(16);
                }
                if (!dataReader.IsDBNull(17))
                {
                    model.CompletedTime = dataReader.GetDateTime(17);
                }
                if (!dataReader.IsDBNull(18))
                {
                    model.CompletedTime1 = dataReader.GetDateTime(18);
                }
                if (!dataReader.IsDBNull(19))
                {
                    model.Comment = dataReader.GetString(19);
                }
                if (!dataReader.IsDBNull(20))
                {
                    model.IsSign = dataReader.GetInt32(20);
                }
                model.Status = dataReader.GetInt32(21);
                if (!dataReader.IsDBNull(22))
                {
                    model.Note = dataReader.GetString(22);
                }
                model.Sort = dataReader.GetInt32(23);
                Guid newGuid;
                if (Guid.TryParse(dataReader.GetString(24), out newGuid))
                {
                    model.SubFlowGroupID = newGuid;
                }

                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 9
0
        protected void Load(string table, List <Dict> list)
        {
            if (table.EndsWith("_DE"))
            {
                table = table.Substring(0, table.Length - 2) + "de";
            }
            if (!table.EndsWith("_de"))
            {
                table += "_de";
            }
            string query = GetSelectQuery(table, list.Select(x => x.DictionaryID).ToArray());

            var hashTable = list.GroupBy(x => x.DictionaryID).ToDictionary(item => item.Key, x => x.ToList());


            MySqlCommand command = connection.CreateCommand();

            command.Transaction = this.transaction;
            command.Connection  = this.connection;
            command.CommandText = query;


            for (int i = 0; i < list.Count; i++)
            {
                list[i].Contents.Clear();
                command.Parameters.AddWithValue("D" + i, list[i].DictionaryID.ToByteArray());
            }

            MySqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                DictEntry entry = new DictEntry();
                entry.EntityID           = reader.GetGuid(0);
                entry.DictID             = reader.GetGuid(1);
                entry.LanguageID         = reader.GetGuid(2);
                entry.Content            = reader.IsDBNull(3) ? "": reader.GetString(3);
                entry.Creation_Timestamp = reader.GetDateTime(4);
                entry.IsDeleted          = reader.GetBoolean(5);
                //Set entry IsDirty to false because it was loaded
                entry.IsDirty = false;
                entry.IsSaved = true;
                foreach (var item in hashTable[entry.DictID])
                {
                    item.Contents.Add(entry);
                }
            }
            reader.Close();
        }
Exemplo n.º 10
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.UsersRole> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.UsersRole> List = new List <BizProcess.Data.Model.UsersRole>();

            BizProcess.Data.Model.UsersRole model = null;
            while (dataReader.Read())
            {
                model           = new BizProcess.Data.Model.UsersRole();
                model.MemberID  = dataReader.GetGuid(0);
                model.RoleID    = dataReader.GetGuid(1);
                model.IsDefault = dataReader.GetBoolean(2);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 11
0
 public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result)
 {
     string query = string.Empty;
     
     query += "SELECT * FROM classifieds WHERE ";
     query += "classifieduuid = ?AdId";
     
     try
     {
         using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
         {
             dbcon.Open();
             using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
             {
                 cmd.Parameters.AddWithValue("?AdId", ad.ClassifiedId.ToString());
                 
                 using (MySqlDataReader reader = cmd.ExecuteReader())
                 {
                     if(reader.Read ())
                     {
                         ad.CreatorId = new UUID(reader.GetGuid("creatoruuid"));
                         ad.ParcelId = new UUID(reader.GetGuid("parceluuid"));
                         ad.SnapshotId = new UUID(reader.GetGuid("snapshotuuid"));
                         ad.CreationDate = Convert.ToInt32(reader["creationdate"]);
                         ad.ExpirationDate = Convert.ToInt32(reader["expirationdate"]);
                         ad.ParentEstate = Convert.ToInt32(reader["parentestate"]);
                         ad.Flags = (byte)reader.GetUInt32("classifiedflags");
                         ad.Category = reader.GetInt32("category");
                         ad.Price = reader.GetInt16("priceforlisting");
                         ad.Name = reader.GetString("name");
                         ad.Description = reader.GetString("description");
                         ad.SimName = reader.GetString("simname");
                         ad.GlobalPos = reader.GetString("posglobal");
                         ad.ParcelName = reader.GetString("parcelname");
                         
                     }
                 }
             }
             dbcon.Close();
         }
     }
     catch (Exception e)
     {
         m_log.DebugFormat("[PROFILES_DATA]" +
                          ": GetPickInfo exception {0}", e.Message);
     }
     return true;
 }
Exemplo n.º 12
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.Log> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.Log> List = new List <BizProcess.Data.Model.Log>();

            BizProcess.Data.Model.Log model = null;
            while (dataReader.Read())
            {
                model           = new BizProcess.Data.Model.Log();
                model.ID        = dataReader.GetGuid(0);
                model.Title     = dataReader.GetString(1);
                model.Type      = dataReader.GetString(2);
                model.WriteTime = dataReader.GetDateTime(3);
                if (!dataReader.IsDBNull(4))
                {
                    model.UserID = dataReader.GetGuid(4);
                }
                if (!dataReader.IsDBNull(5))
                {
                    model.UserName = dataReader.GetString(5);
                }
                if (!dataReader.IsDBNull(6))
                {
                    model.IPAddress = dataReader.GetString(6);
                }
                if (!dataReader.IsDBNull(7))
                {
                    model.URL = dataReader.GetString(7);
                }
                if (!dataReader.IsDBNull(8))
                {
                    model.Contents = dataReader.GetString(8);
                }
                if (!dataReader.IsDBNull(9))
                {
                    model.Others = dataReader.GetString(9);
                }
                if (!dataReader.IsDBNull(10))
                {
                    model.OldXml = dataReader.GetString(10);
                }
                if (!dataReader.IsDBNull(11))
                {
                    model.NewXml = dataReader.GetString(11);
                }
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 13
0
        public List <Applicant> GetAllApplicantsLimitedData()
        {
            db.Get_Connection();
            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection = db.conn;

            try
            {
                cmd.CommandText = "SELECT UCL_Applicant.Id, UCL_Applicant.Firstname, UCL_Applicant.Lastname, UCL_ApplicantProcess.Id," +
                                  "UCL_ApplicantProcess.Process, UCL_Interviewer.Firstname, UCL_Interviewer.Lastname FROM UCL_Applicant JOIN UCL_ApplicantProcess ON UCL_Applicant.Process = UCL_ApplicantProcess.Id LEFT OUTER JOIN UCL_Interviewer ON UCL_Interviewer.Id = UCL_Applicant.Interviewer";


                MySqlDataReader reader = cmd.ExecuteReader();
                _listapp = new List <Applicant>();


                while (reader.Read())
                {
                    _app = new Applicant()
                    {
                        Id        = reader.GetGuid(0),
                        Firstname = reader.GetString(1).ToString(),
                        Lastname  = reader.GetString(2).ToString(),

                        Process = new ApplicantProcess()
                        {
                            Id      = reader.GetInt32(3),
                            Process = reader.GetString(4).ToString()
                        }
                    };

                    if (_app.Process.Id != 1)
                    {
                        _app.Interviewer = new Interviewer()
                        {
                            Firstname = reader.GetString(5).ToString(),
                            Lastname  = reader.GetString(6).ToString()
                        };
                    }

                    _listapp.Add(_app);
                }

                return(_listapp);
            }
            catch (Exception)
            {
                db.CloseConnection();

                throw;
            }
            finally
            {
                if (db.conn.State == System.Data.ConnectionState.Open)
                {
                    db.conn.Close();
                }
            }
        }
Exemplo n.º 14
0
        public static Job GetJob(Guid id)
        {
            try
            {
                MyConn.Open();
                MySqlCommand cmd =
                    new MySqlCommand("SELECT j.id, i.title, j.description FROM jobs j WHERE j.id = '" + MySql.Data.MySqlClient.MySqlHelper.EscapeString(id.ToString()) + "'", MyConn);

                Job             job = null;
                MySqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    job = new Job
                    {
                        Id          = rdr.GetGuid(0),
                        Title       = rdr.GetString(1),
                        Description = rdr.GetString(2)
                    };
                }

                return(job);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Oooppss {e.Message}");
                return(null);
            }
            finally
            {
                MyConn.Close();
            }
        }
        public List <Bucketlist> GetBucketlistsByUser(string UserID)
        {
            try
            {
                con.Open();
                string sql = "SELECT Naam, BucketListID, Eigenaar FROM `bucketlist` WHERE Eigenaar = @eigenaar ";
                var    cmd = new MySqlCommand(sql, con);
                cmd.Parameters.AddWithValue("@eigenaar", UserID);
                MySqlDataReader   rdr         = cmd.ExecuteReader();
                List <Bucketlist> Bucketlists = new List <Bucketlist>();
                while (rdr.Read())
                {
                    Bucketlist bucketlist = new Bucketlist();
                    bucketlist.Naam         = rdr.GetString(0);
                    bucketlist.BucketListId = rdr.GetInt16(1);
                    bucketlist.Eignenaar    = rdr.GetGuid(2);
                    Bucketlists.Add(bucketlist);
                }
                return(Bucketlists);
            }

            catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
            finally
            {
                con.Close();
            }
        }
Exemplo n.º 16
0
        public static List <FoundationDataFileState.FileInfo> RetrieveAllSharedInfo(int foundationId)
        {
            var parameters = new ParameterSet();

            parameters.Add(DbType.Int32, "FOUNDATION_ID", foundationId);
            var command = new Command
            {
                SqlStatementId      = "SELECT_ALL_SHARED_INFO",
                ParameterCollection = parameters
            };

            var access = new DataAccess();

            var requestSupporitngFiles = new List <FoundationDataFileState.FileInfo>();

            using (MySqlDataReader reader = access.GetReader(command))
            {
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0))
                    {
                        var fileIds = new FoundationDataFileState.FileInfo
                        {
                            DocumentId = reader.IsDBNull(0) ? Guid.Empty : reader.GetGuid(0),
                            FileName   = reader.IsDBNull(1) ? "" : reader.GetString(1)
                        };
                        fileIds.FilePath = "\\Shared_Documents\\" + fileIds.FileName;
                        requestSupporitngFiles.Add(fileIds);
                    }
                }
            }

            return(requestSupporitngFiles);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.UsersRelation> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.UsersRelation> List = new List <BizProcess.Data.Model.UsersRelation>();

            BizProcess.Data.Model.UsersRelation model = null;
            while (dataReader.Read())
            {
                model            = new BizProcess.Data.Model.UsersRelation();
                model.UserID     = dataReader.GetGuid(0);
                model.OrganizeID = dataReader.GetGuid(1);
                model.IsMain     = dataReader.GetInt32(2);
                model.Sort       = dataReader.GetInt32(3);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.WorkFlowButtons> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.WorkFlowButtons> List = new List <BizProcess.Data.Model.WorkFlowButtons>();

            BizProcess.Data.Model.WorkFlowButtons model = null;
            while (dataReader.Read())
            {
                model       = new BizProcess.Data.Model.WorkFlowButtons();
                model.ID    = dataReader.GetGuid(0);
                model.Title = dataReader.GetString(1);
                if (!dataReader.IsDBNull(2))
                {
                    model.Ico = dataReader.GetString(2);
                }
                if (!dataReader.IsDBNull(3))
                {
                    model.Script = dataReader.GetString(3);
                }
                if (!dataReader.IsDBNull(4))
                {
                    model.Note = dataReader.GetString(4);
                }
                model.Sort = dataReader.GetInt32(5);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 19
0
        public Categoria Procurar(Guid id)
        {
            Categoria categoria = null;

            using (MySqlConnection conexao = new MySqlConnection(this.connectionString))
            {
                conexao.Open();

                MySqlCommand comando = new MySqlCommand();

                comando.CommandText = "SELECT * FROM categoria WHERE id = @id";

                comando.Connection = conexao;

                comando.Parameters.AddWithValue("id", id);

                MySqlDataReader reader = comando.ExecuteReader();

                if (reader.HasRows)
                {
                    categoria = new Categoria();

                    while (reader.Read())
                    {
                        categoria.id        = reader.GetGuid(0);
                        categoria.descricao = reader.GetString(1);
                    }
                }
            }

            return(categoria);
        }
Exemplo n.º 20
0
 public override Guid GetGuid(int ordinal)
 {
     if (types[ordinal].ClrEquivalentType != reader.GetFieldType(ordinal))
     {
         return((Guid)GetValue(ordinal));
     }
     return(reader.GetGuid(ordinal));
 }
Exemplo n.º 21
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <Data.Model.AppLibrary> DataReaderToList(MySqlDataReader dataReader)
        {
            List <Data.Model.AppLibrary> List = new List <Data.Model.AppLibrary>();

            Data.Model.AppLibrary model = null;
            while (dataReader.Read())
            {
                model          = new Data.Model.AppLibrary();
                model.ID       = dataReader.GetGuid(0);
                model.Title    = dataReader.GetString(1);
                model.Address  = dataReader.GetString(2);
                model.Type     = dataReader.GetGuid(3);
                model.OpenMode = dataReader.GetInt32(4);
                if (!dataReader.IsDBNull(5))
                {
                    model.Width = dataReader.GetInt32(5);
                }
                if (!dataReader.IsDBNull(6))
                {
                    model.Height = dataReader.GetInt32(6);
                }
                if (!dataReader.IsDBNull(7))
                {
                    model.Params = dataReader.GetString(7);
                }
                if (!dataReader.IsDBNull(8))
                {
                    model.Manager = dataReader.GetString(8);
                }
                if (!dataReader.IsDBNull(9))
                {
                    model.Note = dataReader.GetString(9);
                }
                if (!dataReader.IsDBNull(10))
                {
                    model.Code = dataReader.GetString(10);
                }
                if (!dataReader.IsDBNull(11))
                {
                    model.UseMember = dataReader.GetString(11);
                }
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 22
0
        private List <RoadFlow.Data.Model.WorkFlowData> DataReaderToList(MySqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.WorkFlowData> workFlowDataList = new List <RoadFlow.Data.Model.WorkFlowData>();

            while (dataReader.Read())
            {
                workFlowDataList.Add(new RoadFlow.Data.Model.WorkFlowData()
                {
                    ID         = dataReader.GetGuid(0),
                    InstanceID = dataReader.GetGuid(1),
                    LinkID     = dataReader.GetGuid(2),
                    TableName  = dataReader.GetString(3),
                    FieldName  = dataReader.GetString(4),
                    Value      = dataReader.GetString(5)
                });
            }
            return(workFlowDataList);
        }
Exemplo n.º 23
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.WorkFlowData> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.WorkFlowData> List = new List <BizProcess.Data.Model.WorkFlowData>();

            BizProcess.Data.Model.WorkFlowData model = null;
            while (dataReader.Read())
            {
                model            = new BizProcess.Data.Model.WorkFlowData();
                model.ID         = dataReader.GetGuid(0);
                model.InstanceID = dataReader.GetGuid(1);
                model.LinkID     = dataReader.GetGuid(2);
                model.TableName  = dataReader.GetString(3);
                model.FieldName  = dataReader.GetString(4);
                model.Value      = dataReader.GetString(5);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 24
0
        // "assists"
        // "points"
        // "blocks"
        // "rebounds"
        // "steals"
        // "threepointattempted"
        // "threepointmade"
        // "turnovers"
        // "twopointattempted"
        // "twopointmade"
        // "freethrowattempted"
        // "freethrowmade"

        #endregion

        public List <NbaGame> GetGames()
        {
            List <NbaGame> gameEventList = new List <NbaGame>();

            using (MySqlConnection mySqlConnection = MySqlConnection)
            {
                mySqlConnection.Open();
                const string storedProcedure = "pbp.GetGames";

                using (MySqlCommand mySqlCommand = new MySqlCommand(storedProcedure, mySqlConnection))
                {
                    mySqlCommand.CommandType = CommandType.StoredProcedure;

                    using (MySqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader())
                    {
                        if (!mySqlDataReader.HasRows)
                        {
                            const string error   = "GetGameEvents() has no rows";
                            string       message = $"{error,40}, {storedProcedure,40}\n";
                            Write(message);

                            return(gameEventList);
                        }

                        while (mySqlDataReader.Read())
                        {
                            NbaGame nbaGame = new NbaGame
                            {
                                GameId     = mySqlDataReader.GetGuid("comp_id"),
                                GameTime   = mySqlDataReader.GetDateTime("game_time"),
                                AwayTeamId = mySqlDataReader.GetGuid("away_team_id"),
                                HomeTeamId = mySqlDataReader.GetGuid("home_team_id"),
                                Away       = mySqlDataReader.GetString("away"),
                                Home       = mySqlDataReader.GetString("home")
                            };

                            gameEventList.Add(nbaGame);
                        }

                        return(gameEventList);
                    }
                }
            }
        }
 private ActionItem ReadItem(MySqlDataReader reader)
 {
     return(new ActionItem
     {
         Id = reader.GetGuid(0),
         Content = reader.GetString(1),
         Completed = Convert.ToBoolean(reader.GetByte(2)),
         CreatedAt = reader.GetDateTime(3)
     });
 }
Exemplo n.º 26
0
 public void ParseReader(MySqlDataReader reader)
 {
     Status    = reader.GetString("status");
     Guid      = reader.GetGuid("id");
     Username  = reader.GetString("username");
     FirstName = reader.GetString("firstName");
     LastName  = reader.GetString("lastName");
     Email     = reader.GetString("email");
     Password  = reader.GetString("password");
 }
Exemplo n.º 27
0
        public static List <FoundationDataFileState.FileInfo> RetrieveAllRequestInfo(int foundationId)
        {
            var parameters = new ParameterSet();

            parameters.Add(DbType.Int32, "FOUNDATION_ID", foundationId);
            var command = new Command
            {
                SqlStatementId      = "SELECT_ALL_REQUEST_INFO",
                ParameterCollection = parameters
            };

            var access = new DataAccess();

            var requestSupporitngFiles = new List <FoundationDataFileState.FileInfo>();

            using (MySqlDataReader reader = access.GetReader(command))
            {
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0))
                    {
                        var fileIds = new FoundationDataFileState.FileInfo
                        {
                            AnswerId     = reader.GetGuid(0),
                            SubmissionId = reader.IsDBNull(1) ? -1 : reader.GetInt32(1),
                            RequestId    = reader.IsDBNull(2) ? -1 : reader.GetInt32(2),
                            FileName     = reader.IsDBNull(3)
                                                                ? ""
                                                                : reader.GetString(3)
                                           .Split(new [] { "[:|:]" }, StringSplitOptions.None)[0],
                            Question    = reader.IsDBNull(5) ? "" : reader.GetString(5),
                            ProcessId   = reader.IsDBNull(7) ? -1 : reader.GetInt32(7),
                            RequestGuid = reader.IsDBNull(8) ? Guid.Empty : reader.GetGuid(8)
                        };
                        fileIds.FilePath = "Requests\\Submissions\\" + fileIds.RequestId + "_" + fileIds.SubmissionId + "_"
                                           + fileIds.FileName;
                        requestSupporitngFiles.Add(fileIds);
                    }
                }
            }

            return(requestSupporitngFiles);
        }
Exemplo n.º 28
0
        public List <AdminAlert> GetAllAlert()
        {
            MySqlConnection conn = null;

            try
            {
                conn = ConnectionManager.GetConnection();

                MySqlCommand cmd = new MySqlCommand(GET_ALL_ADMIN_ALERTS, conn);

                MySqlDataReader rs = cmd.ExecuteReader();

                List <AdminAlert> adminAlerts = new List <AdminAlert>();

                while (rs.Read())
                {
                    Guid     id           = rs.GetGuid(0);
                    string   email        = rs.GetString(1);
                    DateTime creationDate = rs.GetDateTime(2);
                    double   lat          = rs.GetDouble(3);
                    double   longi        = rs.GetDouble(4);
                    string   alert        = rs.GetString(5);
                    Guid     parentId     = rs.GetGuid(6);
                    Guid     childId      = rs.GetGuid(7);
                    adminAlerts.Add(new AdminAlert(id, email, creationDate, lat, longi, alert, parentId, childId));
                }

                return(adminAlerts);
            }
            catch (MySqlException e)
            {
                Console.WriteLine(e.StackTrace.ToString());
            }
            finally
            {
                if (conn != null && conn.State != System.Data.ConnectionState.Closed)
                {
                    conn.Close();
                }
            }
            return(null);
        }
Exemplo n.º 29
0
        /// <summary>
        /// 查询所有ID和名称
        /// </summary>
        public Dictionary <Guid, string> GetAllIDAndName()
        {
            string sql = "SELECT ID,Name FROM WorkFlow WHERE Status<4 ORDER BY Name";
            Dictionary <Guid, string> dict       = new Dictionary <Guid, string>();
            MySqlDataReader           dataReader = dbHelper.GetDataReader(sql);

            while (dataReader.Read())
            {
                dict.Add(dataReader.GetGuid(0), dataReader.GetString(1));
            }
            dataReader.Close();
            return(dict);
        }
Exemplo n.º 30
0
        public AdminAlert GetAdminAlertById(Guid id)
        {
            MySqlConnection conn = null;

            try
            {
                conn = ConnectionManager.GetConnection();

                MySqlCommand cmd = new MySqlCommand(GET_ADMIN_ALERT_BY_ID, conn);
                cmd.Parameters.AddWithValue("@id", id);

                MySqlDataReader rs = cmd.ExecuteReader();

                rs.Read();

                id = rs.GetGuid(0);
                string   email        = rs.GetString(1);
                DateTime creationDate = rs.GetDateTime(2);
                double   lat          = rs.GetDouble(3);
                double   longi        = rs.GetDouble(4);
                string   alert        = rs.GetString(5);
                Guid     parentId     = rs.GetGuid(6);
                Guid     childId      = rs.GetGuid(7);

                return(new AdminAlert(id, email, creationDate, lat, longi, alert, parentId, childId));
            }
            catch (MySqlException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message.ToString());
            }
            finally
            {
                if (conn != null && conn.State != System.Data.ConnectionState.Closed)
                {
                    conn.Close();
                }
            }
            return(null);
        }