public static bool AddNew(HDS_Category cat)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         exMana.AddToHDS_Category(cat);
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
 public static bool Update(HDS_Category cat)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_Category obj = exMana.HDS_Category.First(temp => temp.Cat_ID == cat.Cat_ID);
         obj.Cat_Name = cat.Cat_Name;
         obj.Cat_Description = cat.Cat_Description;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
 /// <summary>
 /// Create a new HDS_Category object.
 /// </summary>
 /// <param name="cat_ID">Initial value of the Cat_ID property.</param>
 public static HDS_Category CreateHDS_Category(global::System.Int32 cat_ID)
 {
     HDS_Category hDS_Category = new HDS_Category();
     hDS_Category.Cat_ID = cat_ID;
     return hDS_Category;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the HDS_Category EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToHDS_Category(HDS_Category hDS_Category)
 {
     base.AddObject("HDS_Category", hDS_Category);
 }