public void AddHandBookPerson(IPerson key, PlaceWork placeWork)
 {
     if (key == null || placeWork == null)
     {
         throw new Exception("Не был введён ключ или место работы");
     }
     _directory.Add(key, placeWork);
 }
Пример #2
0
        private void data_place_work_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            PlaceWork place = new PlaceWork();

            place = place_work[e.RowIndex];
            PlaceForm place_form = new PlaceForm(place);

            place_form.Show();
        }
Пример #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Family != null ? Family.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Surname != null ? Surname.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Pol;
         hashCode = (hashCode * 397) ^ DateRo.GetHashCode();
         hashCode = (hashCode * 397) ^ DateSm.GetHashCode();
         hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TypeUl != null ? TypeUl.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Street != null ? Street.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (House != null ? House.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Apartament != null ? Apartament.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Housing != null ? Housing.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Phone != null ? Phone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PlaceWork != null ? PlaceWork.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Dop != null ? Dop.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateExit.GetHashCode();
         return(hashCode);
     }
 }
Пример #4
0
        public PlaceForm(PlaceWriter place_writer)
        {
            InitializeComponent();
            place_Work = null;

            place_Writer = place_writer;
            this.Cursor  = Cursors.WaitCursor;

            var    webClient  = new WebClient();
            var    webClient2 = new WebClient();
            string url        = "http://94.230.164.34:8080/api/PicturePlace?id=" + place_Writer.Id_place;

            webClient.DownloadDataCompleted += DownloadDataCompleted;
            webClient.DownloadDataTaskAsync(url);



            place_name_lbl.Text = place_Writer.Place_name;
            adress_lbl.Text    += place_Writer.Place_address;
            rating_lbl.Text    += place_Writer.Place_rating;
            place_name_lbl.Left = 750 - place_name_lbl.Width / 2;
            adress_lbl.Left     = 750 - adress_lbl.Width / 2;
            rating_lbl.Left     = 750 - rating_lbl.Width / 2;
            if (MainForm.user != null)
            {
                mark_lbl.Visible   = true;
                mark_combo.Visible = true;
                add_lbl.Visible    = true;
                add_combo.Visible  = true;
                data_comments.AllowUserToAddRows = true;
            }
            if (place_Writer.Place_description != null)
            {
                web.DocumentText = place_Writer.Place_description;
            }
            else
            {
                web.DocumentText = Description.empty_description;
            }

            url = "http://94.230.164.34:8080/api/CommentPlace?id=" + place_Writer.Id_place;
            try
            {
                string response_comments = Encoding.UTF8.GetString(webClient2.DownloadData(url));
                comments = JsonConvert.DeserializeObject <List <Comment_Place> >(response_comments);

                data_comments.Rows.Clear();
                for (int i = 0; i < comments.Count; i++)
                {
                    data_comments.Rows.Add();
                    data_comments.Rows[i].Cells[0].Value = comments[i].Comment;
                    data_comments.Rows[i].Cells[1].Value = comments[i].Nick;
                    data_comments.Rows[i].Cells[2].Value = comments[i].Date.Value.Day.ToString() + "." + comments[i].Date.Value.Month.ToString() + "." + comments[i].Date.Value.Year.ToString();
                    data_comments.Rows[i].ReadOnly       = true;
                }
            }
            catch
            {
                Messages.ErrorComments();
            }


            if (MainForm.user != null)
            {
                url = "http://94.230.164.34:8080/api/Routes?nick=" + MainForm.user.Nick;
                try
                {
                    response     = Encoding.UTF8.GetString(webClient.DownloadData(url));
                    route_writer = JsonConvert.DeserializeObject <List <RouteWriter> >(response);
                    add_combo.Items.Clear();
                    for (int i = 0; i < route_writer.Count; i++)
                    {
                        add_combo.Items.Add(route_writer[i].Route_name);
                    }
                }
                catch
                {
                    Messages.ErrorRoutes();
                }
            }
        }