Esempio n. 1
0
 private void DoAdd(object sender, EventArgs args)
 {
     this.CurrentPack = new Pack();
     this.CrudOp = CrudState.Create;
     this.InitState();
     this.EditMode();
 }
Esempio n. 2
0
 public PacksWindow()
     : base(Gtk.WindowType.Toplevel)
 {
     this.Build();
     this.CustomBuild();
     this.Connect();
     this.InitState();
     this.CrudOp = CrudState.None;
 }
Esempio n. 3
0
 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;
     }
 }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        public IActionResult Delete(string id)
        {
            CrudState state = _repository.Delete(id);

            if (state == CrudState.Success)
            {
                return(Ok(true));
            }
            else
            {
                return(NotFound(false));
            }
        }
Esempio n. 6
0
        public IActionResult Update(T entity) // updaterange yapılabilir.
        {
            CrudState state = _repository.Update(entity);

            if (state == CrudState.Success)
            {
                return(Ok(entity));
            }
            else
            {
                return(NotFound());
            }
        }
Esempio n. 7
0
        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
            }
        }
Esempio n. 8
0
        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());
            }
        }
Esempio n. 9
0
        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);
            }
        }
Esempio n. 10
0
        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;
        }
Esempio n. 11
0
        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;
            }
        }
Esempio n. 12
0
 private void DoCancel(object sender, EventArgs args)
 {
     this.InitUsers();
     this.CrudOp = CrudState.None;
 }
Esempio n. 13
0
 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;
 }
Esempio n. 14
0
        private void Init()
        {
            this.InitGral();
            this.InitPayment();

            this.InitUsers();
            this.CrudOp = CrudState.None;
        }
Esempio n. 15
0
 private void DoAdd(object sender, EventArgs args)
 {
     this.CleanUserForm();
     this.UsersEditMode();
     this.CrudOp = CrudState.Create;
 }
Esempio n. 16
0
 private void DoEdit(object sender, EventArgs args)
 {
     this.ChangePassword = false;
     this.CrudOp = CrudState.Update;
     this.UsersEditMode();
 }
Esempio n. 17
0
        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);
        }
Esempio n. 18
0
 private void SetCrudState(CrudState state)
 {
     _state = state;
 }
Esempio n. 19
0
 private void DoNew(object sender, EventArgs args)
 {
     this.CrudOp = CrudState.Create;
     this.EditMode();
 }
Esempio n. 20
0
 private void DoEdit(object sender, EventArgs args)
 {
     this.CrudOp = CrudState.Update;
     this.EditMode();
 }