Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("BranchID,ClientID,Abbr,Branch_Name,Branch_Display,Branch_Type,Address_1,Address_2,Address_3,City,StateOrProvince,PostalCode,CountryRegion,Phone,Fax,Notes,active,EDD,DateAdded")] LIMS_Branches lIMS_Branches)
        {
            if (id != lIMS_Branches.BranchID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lIMS_Branches);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LIMS_BranchesExists(lIMS_Branches.BranchID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(lIMS_Branches));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("BranchID,ClientID,Abbr,Branch_Name,Branch_Display,Branch_Type,Address_1,Address_2,Address_3,City,StateOrProvince,PostalCode,CountryRegion,Phone,Fax,Notes,active,EDD,DateAdded")] LIMS_Branches lIMS_Branches)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lIMS_Branches);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(lIMS_Branches));
        }