Exemplo n.º 1
0
 public IActionResult EditSite(SiteForm site)
 {
     if (ModelState.IsValid)
     {
         Site editsite = new Site
         {
             SiteCode = site.SiteCode,
             SiteName = site.SiteName,
             Tel      = site.Tel,
             Website  = site.Website,
             Postcode = site.Postcode,
         };
         Address editaddress = new Address
         {
             Postcode = site.Postcode,
             Street   = site.Street,
             City     = site.City,
         };
         _Context.Sites.Update(editsite);
         _Context.Addresses.Update(editaddress);
         _Context.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     return(RedirectToAction("Index", "Sites"));
 }
Exemplo n.º 2
0
        private void lbtAddnew_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            SiteForm frm = new SiteForm(new ForlabSite()
            {
                Region = DataRepository.GetRegionById(_regionid)
            }, MdiParentForm);

            frm.ShowDialog();
        }
Exemplo n.º 3
0
        public override void EditSelectedItem()
        {
            SiteForm frm = new SiteForm(GetSelectedSite(), MdiParentForm);

            frm.ShowDialog();
        }
Exemplo n.º 4
0
        private void newSiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SiteForm frm = new SiteForm(new ForlabSite(), this);

            frm.ShowDialog();
        }
Exemplo n.º 5
0
 public IActionResult NewSiteForm(SiteForm model)
 {
     _apiService.SubmitForm(model);
     return(Index());// View();
 }