Пример #1
0
 public int AddLogic(Logic obj)
 {
     obj.DateUpdate = DateTime.Now;
     obj.DateAdd = DateTime.Now;
     obj.Suser = System.Web.Security.Membership.GetUser().ToString();
     db.Logics.AddObject(obj);
     db.SaveChanges();
     return (obj.LogicID);
 }
Пример #2
0
 public dbActionResult EditLogic(Logic obj)
 {
     try
     {
         obj.DateUpdate = DateTime.Now;
         obj.Suser = System.Web.Security.Membership.GetUser().ToString();
         db.Logics.Attach(obj);
         db.ObjectStateManager.ChangeObjectState(obj, EntityState.Modified);
         db.SaveChanges();
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = obj.LogicID;
         returnObj.exConcur = null;
         returnObj.exData = null;
         return (returnObj);
     }
     catch (OptimisticConcurrencyException ex)
     {
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = -1;
         returnObj.exConcur = ex;
         returnObj.exData = null;
         return (returnObj);
     }
     catch (DataException ex)
     {
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = -2;
         returnObj.exConcur = null;
         returnObj.exData = ex;
         return (returnObj);
     }
 }
Пример #3
0
 /// <summary>
 /// Create a new Logic object.
 /// </summary>
 /// <param name="logicID">Initial value of the LogicID property.</param>
 /// <param name="descriptionEng">Initial value of the DescriptionEng property.</param>
 /// <param name="descriptionRus">Initial value of the DescriptionRus property.</param>
 public static Logic CreateLogic(global::System.Int32 logicID, global::System.String descriptionEng, global::System.String descriptionRus)
 {
     Logic logic = new Logic();
     logic.LogicID = logicID;
     logic.DescriptionEng = descriptionEng;
     logic.DescriptionRus = descriptionRus;
     return logic;
 }
Пример #4
0
 public void DetachLogic(Logic obj)
 {
     db.Logics.Detach(obj);
 }
Пример #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Logics EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLogics(Logic logic)
 {
     base.AddObject("Logics", logic);
 }