Пример #1
0
 protected void UpdateInsertInterface()
 {
     if (currentPermissions.Insert && currentView is EditableView currentTable)
     {
         gb_addItem.Visible = true;
         OperationFormManager inserter = new OperationFormManager(gb_addItem, currentTable.GetInsertFields())
         {
             SubmitButtonText = "Добавить"
         };
         inserter.Submit += currentTable.InsertValuesFromFields;
         inserter.Error  += OperationErrorHandler;
         inserter.Build();
         inserter.SuccessSubmit += SuccessItemInserted;
     }
     else
     {
         gb_addItem.Visible = false;
     }
 }
Пример #2
0
 protected void UpdateUpdateInterface()
 {
     if (currentPermissions.Update && rows > 0 && currentView is EditableView currentTable)
     {
         gb_changeItem.Visible = true;
         OperationFormManager updater = new OperationFormManager(gb_changeItem, currentTable.GetUpdateFields())
         {
             SubmitButtonText = "Изменить"
         };
         updater.Submit += currentTable.UpdateItemFromFields;
         updater.Error  += OperationErrorHandler;
         updater.Build();
         updater.SuccessSubmit += SuccessItemUpdated;
     }
     else
     {
         gb_changeItem.Visible = false;
     }
 }
Пример #3
0
        protected void InitAddWorkerFields()
        {
            EditableView worker = Program.Container.GetViewsSet()
                                  .GetViews((view) => view.Name == "Сотрудник")
                                  .First() as EditableView;

            addWorkerFields         = worker.GetInsertFields();
            pasportInput            = addWorkerFields["pasport"] as TextField;
            pasportInput.PreventSet = true;

            createWorkerFormManager = new OperationFormManager(p_addToWorker, addWorkerFields)
            {
                ShowSubmitButton = false
            };
            createWorkerFormManager.Submit += worker.InsertValuesFromFields;
            createWorkerFormManager.Error  += FormManager_Error;
            createWorkerFormManager.Build();
            createWorkerFormManager.SuccessSubmit += AddWorkerFormManager_SuccessSubmit;
        }
Пример #4
0
        protected void UpdateDeleteInterface()
        {
            if (currentPermissions.Delete && rows > 0 && currentView is EditableView currentTable)
            {
                gb_deleteItem.Visible = true;
                OperationFormManager deleter = new OperationFormManager(gb_deleteItem, currentTable.GetDeleteFields())
                {
                    SubmitButtonText = "Удалить"
                };

                deleter.Submit += currentTable.DeleteItemWithFields;
                deleter.Error  += OperationErrorHandler;
                deleter.Build();
                deleter.SuccessSubmit += SuccessItemDelete;
            }
            else
            {
                gb_deleteItem.Visible = false;
            }
        }