public ActionResult Edit(int id)
        {
            var viewModel    = service.GetElement(id);
            var bindingModel = new PokupatelBindingModel
            {
                Id           = id,
                PokupatelFIO = viewModel.PokupatelFIO
            };

            return(View(bindingModel));
        }
 private void FormPokupatel_Load(object sender, EventArgs e)
 {
     if (id.HasValue)
     {
         try
         {
             PokupatelViewModel view = service.GetElement(id.Value);
             if (view != null)
             {
                 textBoxFIO.Text = view.PokupatelFIO;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
         }
     }
 }