/// <summary> /// Saves the ClassLevelInfo. /// </summary> /// <returns>ClassLevelInfo Object</returns> public ClassLevelInfo SaveClassLevelInfo() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_ClassLevel"; command.Parameters.Add(dbconn.GenerateParameterObj("@ClassLevelID", SqlDbType.Int, ClassLevelID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ClassID", SqlDbType.Int, ClassID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ClassLevel", SqlDbType.Int, ClassLevel.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@BonusFeat", SqlDbType.Int, BonusFeat.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Talent", SqlDbType.Int, Talent.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@BaseAttack", SqlDbType.Int, BaseAttack.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ForcePointBase", SqlDbType.Int, ForcePointBase.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ForceTechnique", SqlDbType.Int, ForceTechnique.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ForceSecret", SqlDbType.Int, ForceSecret.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@MedicalSecret", SqlDbType.Int, MedicalSecret.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }
public override string ToString() { return("Name: " + Name.ToString() + "\n" + "Class Level: " + ClassLevel.ToString()); }
public void Save() { UserSetting _c = UserSetting.GetSettings("RPT"); _c["FID"] = _id.ToString(); _c["FNAME"] = HttpUtility.UrlDecode(_name); _c["FTYPE"] = _reptype.ToString(); _c["STDT"] = _start.ToString("MM/dd/yyyy HH:mm:ss"); _c["ENDT"] = _end.ToString("MM/dd/yyyy HH:mm:ss"); _c["RANGE"] = ConvertRangeToString(_range); if (_yaxis == Grouping.Location) { _c["SLAYAX"] = Grouping.Location.ToString() + "," + LocationTypeID.ToString(); } else if (_yaxis == Grouping.Class) { _c["SLAYAX"] = Grouping.Class.ToString() + "," + ClassLevel.ToString(); } else { _c["SLAYAX"] = _yaxis.ToString(); } if (_subyaxis == Grouping.Location) { _c["SLASYAX"] = Grouping.Location.ToString() + "," + SubLocationTypeID.ToString(); } else if (_subyaxis == Grouping.Class) { _c["SLASYAX"] = Grouping.Class.ToString() + "," + SubClassLevel.ToString(); } else { _c["SLASYAX"] = _subyaxis.ToString(); } _c["SLAPRT"] = _priority.ToString(); _c["SLACLS"] = _class.ToString(); _c["SLACTG"] = _creationcategory.ToString(); _c["SLASTG"] = _submissioncat.ToString(); _c["SLARTG"] = _resolutioncat.ToString(); _c["SLALCT"] = _location.ToString(); _c["SLATCH"] = _technician.ToString(); _c["SLASBY"] = _submittedby.ToString(); _c["SLACBY"] = _closedby.ToString(); _c["SLAACC"] = _account.ToString(); _c["SLAACCL"] = _accountLocation.ToString(); _c["SLAACCPL"] = _accountParentLocation.ToString(); _c["TECHTYPE"] = technicianType.ToString(); _c["CALLCENTER"] = handledByCallCenter.ToString(); //tkt #3949: Level Filter added to Ticket Count Report _c["TICKETLEVEL"] = _ticket_level.ToString(); //tkt #3632: Add Support Groups to Ticket Count Report criteria _c["SUPPORTGROUP"] = _support_group.ToString(); _c["AGEDAY"] = _age.ToString(); _c["AGERANGE"] = _age_equal.ToString(); _c["ASSETFILTER"] = _asset_filter; _c["SLAGRAPHWIDTH"] = _sla_graph_width_id.ToString(); _c["SLAGRAPHVIEW"] = _sla_graph_view_id.ToString(); }
public string GetQueryString() { string _res = string.Empty; _res += "&ds=" + HttpUtility.UrlEncode(_start.ToString("MM/dd/yyyy HH:mm:ss")); _res += "&de=" + HttpUtility.UrlEncode(_end.ToString("MM/dd/yyyy HH:mm:ss")); _res += "&dr=" + HttpUtility.UrlEncode(ConvertRangeToString(_range)); if (_yaxis == Grouping.Location) { _res += "&ya=" + HttpUtility.UrlEncode(Grouping.Location.ToString() + "," + LocationTypeID.ToString()); } else if (_yaxis == Grouping.Class) { _res += "&ya=" + HttpUtility.UrlEncode(Grouping.Class.ToString() + "," + ClassLevel.ToString()); } else { _res += "&ya=" + HttpUtility.UrlEncode(_yaxis.ToString()); } if (_subyaxis == Grouping.Location) { _res += "&sya=" + HttpUtility.UrlEncode(Grouping.Location.ToString() + "," + SubLocationTypeID.ToString()); } else if (_subyaxis == Grouping.Class) { _res += "&sya=" + HttpUtility.UrlEncode(Grouping.Class.ToString() + "," + SubClassLevel.ToString()); } else { _res += "&sya=" + HttpUtility.UrlEncode(_subyaxis.ToString()); } if (_priority != 0) { _res += "&prt=" + _priority.ToString(); } if (_class != 0) { _res += "&cls=" + _class.ToString(); } if (_creationcategory != 0) { _res += "&ctg=" + _creationcategory.ToString(); } if (_submissioncat != 0) { _res += "&stg=" + _submissioncat.ToString(); } if (_resolutioncat != 0) { _res += "&rtg=" + _resolutioncat.ToString(); } if (_location != 0) { _res += "&lct=" + _location.ToString(); } if (_technician != 0) { _res += "&tch=" + _technician.ToString(); } if (_submittedby != 0) { _res += "&sby=" + _submittedby.ToString(); } if (_closedby != 0) { _res += "&cby=" + _closedby.ToString(); } if (_account != 0) { _res += "&acc=" + _account.ToString(); } if (_accountLocation != 0) { _res += "&accl=" + _accountLocation.ToString(); } if (_accountParentLocation != 0) { _res += "&accpl=" + _accountParentLocation.ToString(); } _res += "&tcht=" + HttpUtility.UrlEncode(technicianType.ToString()); _res += "&hcc=" + HttpUtility.UrlEncode(handledByCallCenter.ToString()); if (_ticket_level != 0) { _res += "&lvl=" + _ticket_level.ToString(); } if (_support_group != 0) { _res += "&sg=" + _support_group.ToString(); } if (_age >= 0) { _res += "&age=" + _age.ToString(); } _res += "&ager=" + HttpUtility.UrlEncode(_age_equal.ToString()); if (_asset_filter.Length > 0) { _res += "&ass=" + HttpUtility.UrlEncode(_asset_filter); } if (_sla_graph_width_id != 0) { _res += "&slaw=" + _sla_graph_width_id.ToString(); } if (_sla_graph_view_id != 0) { _res += "&slag=" + _sla_graph_view_id.ToString(); } return(_res.TrimStart('&')); }
public void WriteXml(XmlWriter writer) { //new XmlDocument().Save(writer); if (Name != null) { writer.WriteAttributeString("Name", Name); } if (PlayerName != null) { writer.WriteAttributeString("PlayerName", PlayerName); } if (Class != null) { writer.WriteStartElement("Class"); writer.WriteAttributeString("Level", ClassLevel.ToString()); writer.WriteString(Class.Name); writer.WriteEndElement(); } if (SecondaryClass != null) { writer.WriteStartElement("SecondaryClass"); writer.WriteAttributeString("Level", SecondaryClassLevel.ToString()); writer.WriteString(SecondaryClass.Name); writer.WriteEndElement(); } if (Race != null) { writer.WriteElementString("Race", Race.Name); } writer.WriteElementString("Speed", Speed.ToString()); writer.WriteElementString("Size", Size.ToString()); writer.WriteElementString("MaxHealthPoints", MaxHealthPoints.ToString()); writer.WriteElementString("CurrentHealthPoints", CurrentHealthPoints.ToString()); writer.WriteElementString("Bruise", Bruise.ToString()); XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); ns.Add("", ""); XmlSerializer otherSer; { writer.WriteStartElement("Inventory"); writer.WriteAttributeString("Name", Inventory.Name); if (_mainWeapon != null) { otherSer = new XmlSerializer(typeof(Weapon)); writer.WriteStartElement("MainWeapon"); otherSer.Serialize(writer, _mainWeapon, ns); writer.WriteEndElement(); } otherSer = new XmlSerializer(typeof(Armor)); if (_mainArmor != null) { writer.WriteStartElement("MainArmor"); otherSer.Serialize(writer, _mainArmor, ns); writer.WriteEndElement(); } if (_mainShield != null) { writer.WriteStartElement("MainShield"); otherSer.Serialize(writer, _mainShield, ns); writer.WriteEndElement(); } otherSer = new XmlSerializer(typeof(Pouch)); otherSer.Serialize(writer, Inventory.Pouch, ns); { writer.WriteStartElement("Bag"); XmlSerializer serItem = new XmlSerializer(typeof(Item)); XmlSerializer serArmo = new XmlSerializer(typeof(Armor)); XmlSerializer serWeap = new XmlSerializer(typeof(Weapon)); foreach (object it in Inventory.Bag.Where((i) => i != MainWeapon && i != MainArmor && i != MainShield)) { if (it.GetType() == typeof(Item)) { serItem.Serialize(writer, it, ns); } else if (it.GetType() == typeof(Weapon)) { serWeap.Serialize(writer, it, ns); } else if (it.GetType() == typeof(Armor)) { serArmo.Serialize(writer, it, ns); } } writer.WriteEndElement(); } writer.WriteEndElement(); } writer.WriteStartElement("Attributes"); foreach (HeroAttribute.Type t in Enum.GetValues(typeof(HeroAttribute.Type))) { writer.WriteStartElement(t.ToString()); writer.WriteAttributeString("Value", _atr[(int)t].ToString()); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("SkillMarks"); foreach (Skill.Type t in Enum.GetValues(typeof(Skill.Type))) { //writer.WriteComment(Skill.GetPolishName(t)); writer.WriteStartElement(t.ToString()); writer.WriteAttributeString("Value", _marks[(int)t].ToString()); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteElementString("Age", Age.ToString()); writer.WriteElementString("Height", Height.ToString()); writer.WriteElementString("Weight", Weight.ToString()); if (Sex != null) { writer.WriteElementString("Sex", Sex); } if (EyesColor != null) { writer.WriteElementString("EyesColor", EyesColor); } if (HairColor != null) { writer.WriteElementString("HairColor", HairColor); } }
/// <summary> /// Saves the character class level. /// </summary> /// <returns>CharacterClassLevel Object</returns> public CharacterClassLevel SaveCharacterClassLevel() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_CharacterClassLevel"; command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterID", SqlDbType.Int, CharacterID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ClassID", SqlDbType.Int, ClassID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ClassLevel", SqlDbType.Int, ClassLevel.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }