public static void UpdateEngine(TableStatu stat) { try { using (ServerEntities db = new ServerEntities()) { db.Entry(stat).State = EntityState.Modified; db.SaveChanges(); } } catch (Exception err) { Global.LogError(err); // throw; } }
public void Deactivate(string username) { try { using (var ent = new ServerEntities()) { var result = (from ci in ent.Client_Info join cd in ent.Client_Details on ci.id equals cd.Client_Id where ci.Client_Uname == username select cd).FirstOrDefault <Client_Details>(); //if (result == null) result.IsLogged = false; ent.SaveChanges(); } } catch (Exception ex) { Logger.Write(ex.Message, ChitChatAPI.Enums.LogLevel.Error, ConsoleColor.Red); } }