Пример #1
0
        private void LoadSkills(DataTable dtSkills)
        {
            MethodBase lmth          = MethodBase.GetCurrentMethod();
            string     lsRoutineName = lmth.DeclaringType + "." + lmth.Name;

            try
            {
                foreach (DataRow ldr in dtSkills.Rows)
                {
                    cPlayerSkill cAdd = new
                                        cPlayerSkill
                    {
                        SkillName      = ldr["SkillName"].ToString(),
                        SkillLevel     = ldr["SkillLevel"].ToString(),
                        PlayerComments = ldr["PlayerComments"].ToString(),
                        Comments       = ldr["Comments"].ToString(),
                        RecordStatus   = RecordStatuses.Active
                    };

                    int iTemp;
                    if (int.TryParse(ldr["PlayerSkillID"].ToString(), out iTemp))
                    {
                        cAdd.PlayerSkillID = iTemp;
                    }
                    if (int.TryParse(ldr["PlayerProfileID"].ToString(), out iTemp))
                    {
                        cAdd.PlayerProfileID = iTemp;
                    }

                    PlayerSkills.Add(cAdd);
                }
            }
            catch (Exception ex)
            {
                ErrorAtServer lobjError = new ErrorAtServer();
                lobjError.ProcessError(ex, lsRoutineName, UserName + lsRoutineName);
            }
        }
Пример #2
0
        public void Load(string UserName, Int32 intUserID)
        {
            MethodBase lmth          = MethodBase.GetCurrentMethod(); // this is where we use refelection to store the name of the method and class to use it to report errors
            string     lsRoutineName = lmth.DeclaringType + "." + lmth.Name;

            SortedList slParams = new SortedList(); // I use a sortedlist  wich is a C# hash table to store the paramter and value

            slParams.Add("@PlayerResumeID", PlayerProfileID);
            try
            {
                DataSet ldsPlayerInfo = cUtilities.LoadDataSet("uspGetPlayerResumeByID", slParams, "LARPortal", UserName, lsRoutineName);
                if (ldsPlayerInfo.Tables[0].Rows.Count > 0)
                {
                    PlayerComments = ldsPlayerInfo.Tables[0].Rows[0]["ResumeContents"].ToString();
                }

                PlayerSkills = new List <cPlayerSkill>();

                foreach (DataRow dRow in ldsPlayerInfo.Tables[1].Rows)
                {
                    cPlayerSkill NewSkill = new cPlayerSkill
                    {
                        SkillName      = dRow["SkillName"].ToString(),
                        SkillLevel     = dRow["SkillLevel"].ToString(),
                        PlayerComments = dRow["PlayerComments"].ToString()
                    };

                    NewSkill.PlayerProfileID = PlayerProfileID;

                    int iTemp;
                    if (int.TryParse(dRow["'PlayerSkillID"].ToString(), out iTemp))
                    {
                        NewSkill.PlayerSkillID = iTemp;
                    }

                    PlayerSkills.Add(NewSkill);
                }

                PlayerAffiliations = new List <cPlayerAffiliation>();

                foreach (DataRow dRow in ldsPlayerInfo.Tables[2].Rows)
                {
                    cPlayerAffiliation NewAffil = new cPlayerAffiliation
                    {
                        AffiliationName = dRow["AffiliationName"].ToString(),
                        AffiliationRole = dRow["AffiliationRole"].ToString(),
                        PlayerComments  = dRow["PlayerComments"].ToString(),
                        Comments        = dRow["Comments"].ToString()
                    };

                    NewAffil.PlayerProfileID = PlayerProfileID;

                    int iTemp;
                    if (int.TryParse(dRow["'PlayerAffiliationID"].ToString(), out iTemp))
                    {
                        NewAffil.PlayerAffiliationID = iTemp;
                    }

                    PlayerAffiliations.Add(NewAffil);
                }
            }
            catch (Exception ex)
            {
                ErrorAtServer lobjError = new ErrorAtServer();
                lobjError.ProcessError(ex, lsRoutineName, UserName + lsRoutineName);
            }
        }