public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email_Id,Address,Mobile_Number,Website")] Companydetails companydetails) { if (id != companydetails.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(companydetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanydetailsExists(companydetails.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(companydetails)); }
public async Task <IActionResult> Create([Bind("Id,Name,Email_Id,Address,Mobile_Number,Website")] Companydetails companydetails) { if (ModelState.IsValid) { _context.Add(companydetails); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(companydetails)); }
private void companyDetailsToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Form c in this.MdiChildren) { c.Close(); } Companydetails b = new Companydetails(); b.MdiParent = this; b.Show(); groupBox1.Hide(); }