Пример #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;
        }
Пример #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);
     }
 }
Пример #3
0
 partial void DeleteAlert(Alert instance);
Пример #4
0
 partial void UpdateAlert(Alert instance);
Пример #5
0
 partial void InsertAlert(Alert instance);
Пример #6
0
		private void detach_Alerts(Alert entity)
		{
			this.SendPropertyChanging();
			entity.ChecksMenu = null;
		}
Пример #7
0
		private void attach_Alerts(Alert entity)
		{
			this.SendPropertyChanging();
			entity.ChecksMenu = this;
		}