コード例 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ContinuousLibraries EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToContinuousLibraries(ContinuousLibrary continuousLibrary)
 {
     base.AddObject("ContinuousLibraries", continuousLibrary);
 }
コード例 #2
0
 /// <summary>
 /// Create a new ContinuousLibrary object.
 /// </summary>
 /// <param name="languisticLabel">Initial value of the LanguisticLabel property.</param>
 /// <param name="bottomLeft">Initial value of the BottomLeft property.</param>
 /// <param name="topLeft">Initial value of the TopLeft property.</param>
 /// <param name="topRight">Initial value of the TopRight property.</param>
 /// <param name="bottomRight">Initial value of the BottomRight property.</param>
 public static ContinuousLibrary CreateContinuousLibrary(global::System.String languisticLabel, global::System.Double bottomLeft, global::System.Double topLeft, global::System.Double topRight, global::System.Double bottomRight)
 {
     ContinuousLibrary continuousLibrary = new ContinuousLibrary();
     continuousLibrary.LanguisticLabel = languisticLabel;
     continuousLibrary.BottomLeft = bottomLeft;
     continuousLibrary.TopLeft = topLeft;
     continuousLibrary.TopRight = topRight;
     continuousLibrary.BottomRight = bottomRight;
     return continuousLibrary;
 }
コード例 #3
0
        public int UpdateConFs(ContinuousFuzzySetBLL conFs)
        {
            try
            {
                int result = 0;

                if (!IsExistFSName(conFs.FuzzySetName))//Add new object
                {
                    ContinuousLibrary child = new ContinuousLibrary();
                    child.LanguisticLabel = conFs.FuzzySetName;
                    child.BottomLeft = conFs.Bottom_Left;
                    child.TopLeft = conFs.Top_Left;
                    child.BottomRight = conFs.Bottom_Right;
                    child.TopRight = conFs.Top_Right;

                    db.AddToContinuousLibraries(child);
                    return result = db.SaveChanges(true);
                }
                else//Just update value
                {
                    var _conFs = db.ContinuousLibraries.FirstOrDefault(id => id.LanguisticLabel == conFs.FuzzySetName);
                    _conFs.LanguisticLabel = conFs.FuzzySetName;
                    _conFs.BottomLeft = conFs.Bottom_Left;
                    _conFs.TopLeft = conFs.Top_Left;
                    _conFs.BottomRight = conFs.Bottom_Right;
                    _conFs.TopRight = conFs.Top_Right;

                    return result = db.SaveChanges();
                }
            }
            catch (SQLiteException ex)
            {
                //throw new Exception(ex.Message);
                return -1;
            }
        }