Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 partial void DeleteAlert(Alert instance);
Exemplo n.º 4
0
 partial void UpdateAlert(Alert instance);
Exemplo n.º 5
0
 partial void InsertAlert(Alert instance);
Exemplo n.º 6
0
		private void detach_Alerts(Alert entity)
		{
			this.SendPropertyChanging();
			entity.ChecksMenu = null;
		}
Exemplo n.º 7
0
		private void attach_Alerts(Alert entity)
		{
			this.SendPropertyChanging();
			entity.ChecksMenu = this;
		}