text: /*
   * File: app/view/DialogEmploeeEditViewController1.js
   *
   * This file was generated by Sencha Architect version 4.2.9.
   * http://www.sencha.com/products/architect/
   *
   * This file requires use of the Ext JS 7.3.x Modern library, under independent license.
   * License of Sencha Architect does not include license for Ext JS 7.3.x Modern. For more
   * details see http://www.sencha.com/license or contact license@sencha.com.
   *
   * This file will be auto-generated each and everytime you save your project.
   *
   * Do NOT hand edit this file.
   */
  
  Ext.define('Case.view.DialogEmploeeEditViewController1', {
      extend: 'Ext.app.ViewController',
      alias: 'controller.dialogemploeeadd',
  
      onButtonTap1: function(button, e, eOpts) {
          var me =  this;
          refs = me.getReferences();
  
          if (refs.form.validate()) {
              var cr= button.up('formpanel').getViewModel().get('crecord');
  
  
              Ext.Ajax.request({
                  url: 'emploeelist/add',
                  params:{surname:cr.surname,name:cr.name,patronymic:cr.patronymic , gender:cr.gender,birthdate:cr.birthdate,phonenum:cr.phonenum,
                  passportnum:cr.passportnum,position:cr.position,wages:cr.wages,dismissed:cr.dismissed,comedate:cr.comedate,exitdate:cr.exitdate,direction_id:cr.direction_id},
                  success: function(response, opts) {
  
                      Case.app.getStore('EmploeeStore').load();
                      Case.app.getStore('reports').load();
                      Ext.Msg.alert("Masege" , "Dannie uspeshno soxraneni");
  
                  },
  
                  failure: function(response, opts) {
                      Ext.Msg.alert("Ошибка" , "Poprobuyte esho raz");
                  }
              });
  
  
          }
  
      },
  
      onDialogBeforeShow: function(component, eOpts) {
          let me = this,
          refs = me.getReferences(),
          vm = me.getViewModel();
  
          refs.form.validate();
      }
  
  });