public Int32 SaveAlert(Alert alert) { Alert query; try { using (menuzRusDataContext db = new menuzRusDataContext(base.connectionString)) { query = db.Alerts.FirstOrDefault(m => m.id == alert.id); if (query == default(Alert)) { query = new Alert(); } query.CheckMenuId = alert.CheckMenuId; query.Type = alert.Type; query.Status = alert.Status; if (alert.id == 0) { db.Alerts.InsertOnSubmit(query); } db.SubmitChanges(); } } catch (Exception ex) { return 0; } return query.id; }
public void SaveAlert(Int32 checkMenuId, Boolean state) { Alert alert = new Alert(); try { alert.Status = (Int32)Common.Status.Active; alert.CheckMenuId = checkMenuId; if (!state) { alert.Status = (Int32)Common.Status.NotActive; } alert.Type = (Int32)Common.Alert.DishIsReady; _alertService.SaveAlert(alert); } catch (Exception ex) { base.Log(ex); } }
partial void DeleteAlert(Alert instance);
partial void UpdateAlert(Alert instance);
partial void InsertAlert(Alert instance);
private void detach_Alerts(Alert entity) { this.SendPropertyChanging(); entity.ChecksMenu = null; }
private void attach_Alerts(Alert entity) { this.SendPropertyChanging(); entity.ChecksMenu = this; }