public PManagerForm()
 {
     _company = DataBaseInterface.GetUserCompany(DataSaver.UId, DataSaver.PasswordHash);
     this.InitializeComponent();
     XCompanyLogo.Source = new BitmapImage(new Uri(DataSaver.Path + "camera_a.png", UriKind.Absolute));
     if (_company == null)
     {
         XCompanyInfo.Visibility = Visibility.Hidden;
         XCompanyReg.Visibility = Visibility.Visible;
        
     }
     else
     {
         _init();
     }
 }
 private void ButtonRegistration(object sender, EventArgs e)
 {
     try
     {
         _company = DataBaseInterface.RegistrateCompany(DataSaver.UId, DataSaver.PasswordHash,
             XCompanyName.PValue.ToString(),
             Convert.ToInt32(XCompanyFoundated.PValue.ToString()),
             XCompanySpecializing.PValue.ToString(),
             XCompanyAddress.PValue.ToString(),
             XCompanyLogoR.PPath,
             XCompanyAbout.PValue.ToString());
         XCompanyReg.Visibility = Visibility.Hidden;
         XCompanyInfo.Visibility = Visibility.Visible;
         _init();
     }
     catch
     {
         MessageBox.Show("Не все данные верны");
     }
 }
 public static Company GetCompanyById(int uId, string password, int idForSearch)
 {
     Company c = new Company();
     c.Name = "Sony";
     c.Id = idForSearch;
     c.Logo = new BitmapImage(new Uri(DataSaver.Path + "camera_a.png"));
     c.Address = "Набережная 140";
     c.Specialization = "телефоны, приставки";
     c.Contacts = new List<Contact>();
     Contact t = new Contact();
     t.Value = "vcs_sony";
     t.Type = "skype";
     c.Contacts.Add(t);
     return c;
 }
 public static User GetUserById(int uId, string password, int idForSearch)
 {
     User t=new User();
     t.Login="******";
     t.Id=idForSearch;
     Company c = new Company();
     c.Name = "Sony";
     c.Id = 17;
     User u = new User(t,null,null,null,null,c);
     return u;
 }
 public static SearchResult Search(int uId, string passwordHash, string keyWord)
 {
     var t = new SearchResult();
     Company c = new Company();
     c.Name = "jacobs";
     t.Companies.Add(c);
     User tuser = new User();
     tuser.Login = "******";
     tuser.Id = 147;
     t.Users.Add(new User(tuser, null, null, null, null, null));
     Vacancy v = new Vacancy();
     v.AuthorName = "Подколзин Андрей Юрьевич";
     v.Description = "Being an amazing combination of professionalism, creativity, inspiration and success Just Eat features as the biggest online takeaway marketplace in the world!";
     v.MinPay = 1000; 
     v.Name = "Being an amazing combination";
     v.MaxPay = int.MaxValue;
     t.Vacancies.Add(v);
     return t;
 }
 public static Company RegistrateCompany(int uid, string password, string name, int founded, string spec, string address, string logo, string about)
 {
     Company t = new Company();
     t.Founded = founded.ToString();
     t.Name = name;
     //todo: spec
     /*tCompanyOffice office=new tCompanyOffice();
     office.cAddress=address;
     t.tCompanyOffices.Add(office);*/
     //todo: logo
     //todo: about
     return t;
 }