public ResponseModel AddFeature([FromBody] FeaturesModel objFeatures) { ResponseModel objResponseModel = new ResponseModel(); string result = string.Empty; // FeaturePlanModel feature = new FeaturePlanModel(); int statusCode = 0; //int Result =0; string statusMessage = ""; try { string token = Convert.ToString(Request.Headers["X-Authorized-Token"]); Authenticate authenticate = new Authenticate(); authenticate = SecurityService.GetAuthenticateDataFromTokenCache(Cache, SecurityService.DecryptStringAES(token)); FeaturePlanCaller fCaller = new FeaturePlanCaller(); objFeatures.UserID = authenticate.UserMasterID; result = fCaller.AddFeature(new FeaturePlanService(Cache, Db), objFeatures); statusCode = result != "" ? (int)EnumMaster.StatusCode.RecordNotFound : (int)EnumMaster.StatusCode.Success; statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode); objResponseModel.Status = true; objResponseModel.StatusCode = statusCode; objResponseModel.Message = result; objResponseModel.ResponseData = result; } catch (Exception) { throw; } return(objResponseModel); }
/// <summary> /// Add Feature /// </summary> /// <param name="objFeatures"></param> /// <returns></returns> public string AddFeature(FeaturesModel objFeatures) { int result = 0; string message = string.Empty; try { conn = Db.Connection; MySqlCommand cmd = new MySqlCommand("SP_AddFeature", conn); cmd.Connection = conn; cmd.Parameters.AddWithValue("@Feature_ID", objFeatures.FeatureID); cmd.Parameters.AddWithValue("@Feature_Name", objFeatures.FeatureName); cmd.Parameters.AddWithValue("@Monthly_Price", objFeatures.MonthlyPrice); cmd.Parameters.AddWithValue("@Yearly_Price", objFeatures.YearlyPrice); cmd.Parameters.AddWithValue("@_Tooltip", objFeatures.Tooltip); cmd.Parameters.AddWithValue("@IsActive", objFeatures.IsActive); cmd.Parameters.AddWithValue("@User_ID", objFeatures.UserID); cmd.Parameters.AddWithValue("@Message", ""); cmd.Parameters["@Message"].Direction = ParameterDirection.Output; cmd.CommandType = CommandType.StoredProcedure; result = Convert.ToInt32(cmd.ExecuteNonQuery()); message = Convert.ToString(cmd.Parameters["@Message"].Value); } catch (Exception ex) { throw ex; } return(message); }
public void Initialize() { var contexts = Contexts.sharedInstance; _eventsContext = contexts.events; var modelEntity = contexts.core.CreateEntity(); modelEntity.AddFeaturesModel(new Dictionary <string, IGameFeature>(), new Dictionary <string, UnityAction>()); _model = modelEntity.featuresModel; }
private void AddSpellCastingFeatures(FeaturesModel feature, string className) { int abilityMod = 0; // Reset the description list FeaturesModel newFeature = new FeaturesModel { Name = feature.Name, Description = new List <string> { } }; foreach (var item in feature.Description) { newFeature.Description.Add(item); } switch (feature.AbilityModifier) { case AbilitiesEnum.Cha: abilityMod = this.abilityScores.ChaMod; break; case AbilitiesEnum.Int: abilityMod = this.abilityScores.IntMod; break; case AbilitiesEnum.Wis: abilityMod = this.abilityScores.WisMod; break; } newFeature.Description.Add($"<b>Spell Save DC:</b> {(8 + abilityMod + GetProficiencyBonus()).ToString()}"); newFeature.Description.Add($"<b>Spell Attack Modifier:</b> +{abilityMod + GetProficiencyBonus()}"); this.charClass[className].Features.Add(newFeature); }
public string AddFeature(IFeaturePlan _feature, FeaturesModel objFeature) { _featurePlan = _feature; return(_featurePlan.AddFeature(objFeature)); }
public void Initialize() { _model = _coreContext.featuresModel; }