Exemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainWindow1 = ((kurscachWPF.AddWorker)(target));
                return;

            case 2:
                this.MainBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 3:
                this.Confirm = ((System.Windows.Controls.Button)(target));

            #line 36 "..\..\AddWorker.xaml"
                this.Confirm.Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);

            #line default
            #line hidden
                return;

            case 4:

            #line 51 "..\..\AddWorker.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_3);

            #line default
            #line hidden
                return;

            case 5:
                this.AID = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.ASALARY = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.APOSITION = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 8:
                this.AINFO = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.AFIO = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
 private void add_show(byte key)
 {
     if (CurrentUser.type != 2)
     {
         AddWorker a = new AddWorker();
         foreach (var vac in vacs)
         {
             if (!a.APOSITION.Items.Contains(vac.position))
             {
                 a.APOSITION.Items.Add(vac.position);
             }
         }
         //Позиция на экране
         a.Left = (this.Left) + (this.Width - a.Width) / 2;
         a.Top  = (this.Top) + (this.Height - a.Height) / 2;
         string ar;
         try
         {
             a.NewR          = new R();
             a.NewR2         = new R2();
             ar              = this.GRIDREAL.SelectedItem.ToString();
             a.NewR.Idvacant = int.Parse(ar.Split('=', ' ', ',')[4]);
             string comp = ar.Split('=', ',')[5];
             comp          = comp.Substring(1, comp.Length - 1);
             a.NewR2.Idorg = (from orgid in orgg where orgid.orgname == comp select orgid.Idorg).Max();
             a.AFIO.Text   = CurrentUser.name;
             if (!clear)
             {
                 a.APOSITION.Text = ar.Split('=', ' ')[8];
                 a.ASALARY.Text   = this.TBSalary.Text;
             }
             a.Show();
         }
         catch (Exception e)
         {
             if (key == 2)
             {
                 MessageBox.Show(e.Message);
             }
             a.AFIO.Text = CurrentUser.name;
             a.Show();
             //
         }
     }
     else
     {
         MessageBox.Show("Комании не могут добавлять резюме. Пожалуйста, перелогиньтесь");
     }
 }