public static string AddRisk(string title, string desc, string type) { GuruETCEntities _etc; string msg = string.Empty; try { using (_etc = new DB.GuruETCEntities()) { Risk_Assessment _risk = new Risk_Assessment(); _risk.Risk = title; _risk.Description = desc; _risk.Risk_Type = type; _etc.AddToRisk_Assessment(_risk); _etc.SaveChanges(); return "Success_" + _risk.Id; } } catch (Exception ex) { msg = "Error"; } return msg; }
/// <summary> /// Create a new Risk_Assessment object. /// </summary> /// <param name="id">Initial value of the Id property.</param> public static Risk_Assessment CreateRisk_Assessment(global::System.Int64 id) { Risk_Assessment risk_Assessment = new Risk_Assessment(); risk_Assessment.Id = id; return risk_Assessment; }
/// <summary> /// Deprecated Method for adding a new object to the Risk_Assessment EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRisk_Assessment(Risk_Assessment risk_Assessment) { base.AddObject("Risk_Assessment", risk_Assessment); }