private void DoAdd(object sender, EventArgs args) { this.CurrentPack = new Pack(); this.CrudOp = CrudState.Create; this.InitState(); this.EditMode(); }
public PacksWindow() : base(Gtk.WindowType.Toplevel) { this.Build(); this.CustomBuild(); this.Connect(); this.InitState(); this.CrudOp = CrudState.None; }
public EntityState ConvertState(CrudState crudState) { switch (crudState) { case CrudState.Added: return EntityState.Added; case CrudState.Modified: return EntityState.Modified; case CrudState.Deleted: return EntityState.Deleted; default: return EntityState.Unchanged; } }
public static void LogData(string objectId, string objectType, CrudState state) { DataLogEntry logEntry = new DataLogEntry() { LogType = LogType.Data, ObjectId = objectId, ObjectType = objectType, State = state, }; LogData(logEntry); }
public IActionResult Delete(string id) { CrudState state = _repository.Delete(id); if (state == CrudState.Success) { return(Ok(true)); } else { return(NotFound(false)); } }
public IActionResult Update(T entity) // updaterange yapılabilir. { CrudState state = _repository.Update(entity); if (state == CrudState.Success) { return(Ok(entity)); } else { return(NotFound()); } }
public IActionResult AddRange(List <T> entity) { CrudState state = _repository.Add(entity); if (state == CrudState.Success) { return(Created("/" + typeof(T).Name, entity)); } else { return(Conflict());//hata durumu dönebiliriz } }
public virtual IActionResult Add(T entity) { CrudState state = _repository.Add(entity); if (state == CrudState.Success) { return(Created("/" + typeof(T).Name + "/" + entity.Id, entity)); } else { return(Conflict()); } }
public static EntityState ConvertState(CrudState state) { switch (state) { case CrudState.Added: return(EntityState.Added); case CrudState.Modified: return(EntityState.Modified); case CrudState.Deleted: return(EntityState.Deleted); default: return(EntityState.Unchanged); } }
public void SetEntry(EntryModel model, CrudState state) { if (SelectedEntry != null) { SelectedEntry.PropertyChanged -= SelectedEntryOnPropertyChanged; } SelectedEntry = model; SelectedEntry.PropertyChanged += SelectedEntryOnPropertyChanged; if (SelectedEntryContent != null) { SelectedEntryContent.PropertyChanged -= SelectedEntryContentOnPropertyChanged; } SelectedEntryContent = _folderRepository.GetEntryContent <T>(model); SelectedEntryContent.PropertyChanged += SelectedEntryContentOnPropertyChanged; _state = state; }
private void btnRegister_Click(object sender, RoutedEventArgs e) { MDIMain mdi = (MDIMain)Owner; User u = new User(); u.UserName = txtUserName.Text; u.CreateBy = txtUserName.Text; u.Password = Hash.GetHashString(txtPassword.Text); CrudState state = UOW.Instance.RepUser.Add(u); u = UOW.Instance.RepUser.Get().LastOrDefault(); if (state == CrudState.Success) { MessageBox.Show("Account Registered"); Anasayfa ana = new Anasayfa(mdi); ana.Owner = mdi; mdi.ViewWindow.Content = ana.Content; } }
private void DoCancel(object sender, EventArgs args) { this.InitUsers(); this.CrudOp = CrudState.None; }
private void InitState() { this.AreaEntry.Sensitive = false; this.OkButton.Sensitive = false; this.CancelButton.Sensitive = false; this.DeleteButton.Sensitive = false; this.EditButton.Sensitive = false; this.AddButton.Sensitive = true; this.CrudOp = CrudState.None; this.AreaEntry.Text = ""; this.FillNodeView(); this.AreasNodeView.Sensitive = true; }
private void Init() { this.InitGral(); this.InitPayment(); this.InitUsers(); this.CrudOp = CrudState.None; }
private void DoAdd(object sender, EventArgs args) { this.CleanUserForm(); this.UsersEditMode(); this.CrudOp = CrudState.Create; }
private void DoEdit(object sender, EventArgs args) { this.ChangePassword = false; this.CrudOp = CrudState.Update; this.UsersEditMode(); }
public static void LogDataRelation(string sourceObjectId, string sourceObjectType, string destinationObjectId, string destinationObjectType, CrudState state) { RelationLogEntry logEntry = new RelationLogEntry() { LogType = LogType.Relation, SourceObjectId = sourceObjectId, SourceObjectType = sourceObjectType, DestinationObjectId = destinationObjectId, DestinationObjectType = destinationObjectType, State = state, }; LogDataRelation(logEntry); }
private void SetCrudState(CrudState state) { _state = state; }
private void DoNew(object sender, EventArgs args) { this.CrudOp = CrudState.Create; this.EditMode(); }
private void DoEdit(object sender, EventArgs args) { this.CrudOp = CrudState.Update; this.EditMode(); }