public async Task <IHttpActionResult> PutZone(int id, Zone zone)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != zone.Zone_ID)
            {
                return(BadRequest());
            }

            db.Entry(zone).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ZoneExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult Putincident(string id, incident incident)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != incident.incident_type)
            {
                return(BadRequest());
            }

            db.Entry(incident).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!incidentExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult Edit([Bind(Include = "Id,ulica,nr_domu,kod_pocztowy,miasto,panstwo,id_uzytkownik,szerokosc,dlugosc")] Adres adres)
        {
            if (ModelState.IsValid)
            {
                var        u = db.AspNetUsers.SingleOrDefault(x => x.Email == User.Identity.Name);
                Uzytkownik p = db.Uzytkownik.SingleOrDefault(x => x.id_aspUser == u.Id);
                adres.id_uzytkownik = p.Id;

                string requestUri = string.Format("http://maps.googleapis.com/maps/api/geocode/xml?address={0}&sensor=false", Uri.EscapeDataString(adres.ulica + "+" + adres.nr_domu + "+" + adres.kod_pocztowy + "+" + adres.miasto + "+" + adres.panstwo));

                WebRequest  request  = WebRequest.Create(requestUri);
                WebResponse response = request.GetResponse();
                XDocument   xdoc     = XDocument.Load(response.GetResponseStream());

                XElement result          = xdoc.Element("GeocodeResponse").Element("result");
                XElement locationElement = result.Element("geometry").Element("location");
                XElement lat             = locationElement.Element("lat");
                XElement lng             = locationElement.Element("lng");

                adres.szerokosc = (string)lat;
                adres.dlugosc   = (string)lng;


                db.Entry(adres).State = EntityState.Modified;
                db.SaveChanges();
                return(Redirect("/UzytkownikHome/Index"));
            }
            // ViewBag.id_uzytkownik = new SelectList(db.Uzytkownik, "Id", "imie", adres.id_uzytkownik);
            return(View(adres));
        }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "WorkCenterID,WorkCenterLocation")] WORKCENTER wORKCENTER)
 {
     if (ModelState.IsValid)
     {
         db.Entry(wORKCENTER).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(wORKCENTER));
 }
 public ActionResult Edit([Bind(Include = "Id,Name")] AspNetRoles aspNetRoles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetRoles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetRoles));
 }
 public ActionResult Edit([Bind(Include = "MaterialID,MaterialName,MaterialStandardCost,UnitOfMeasure")] RAWMATERIAL rawMaterial)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rawMaterial).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(rawMaterial));
 }
 public ActionResult Edit([Bind(Include = "Skill1")] SKILL sKILL)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sKILL).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sKILL));
 }
Exemple #8
0
 public ActionResult Edit([Bind(Include = "Cat_id,Cat_name")] categories_table categories_table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(categories_table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(categories_table));
 }
Exemple #9
0
 public ActionResult Edit([Bind(Include = "TerritoryID,TerritoryName")] TERRITORY tERRITORY)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tERRITORY).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tERRITORY));
 }
Exemple #10
0
 public ActionResult Edit([Bind(Include = "Id,Name,Address,StarLevel,UpdateDate")] Hotel hotel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hotel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hotel));
 }
Exemple #11
0
 public ActionResult Edit([Bind(Include = "Id,opis,data_start,data_koniec,color")] Spotkanie spotkanie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(spotkanie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(spotkanie));
 }
 public ActionResult Edit([Bind(Include = "ProductLineID,ProductLineName")] PRODUCT_LINE pRODUCT_LINE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pRODUCT_LINE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pRODUCT_LINE));
 }
 public ActionResult Edit([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName")] AspNetUsers aspNetUsers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetUsers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetUsers));
 }
Exemple #14
0
 public ActionResult Edit([Bind(Include = "u_id,user_name,user_address,user_password,user_type")] user_table user_table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user_table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user_table));
 }
Exemple #15
0
 public ActionResult Edit([Bind(Include = "CustomerID,CustomerName,CustomerAddress,CustomerPostalCode")] CUSTOMER cUSTOMER)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cUSTOMER).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cUSTOMER));
 }
 public ActionResult Edit([Bind(Include = "Id,oMnie")] Info info)
 {
     if (ModelState.IsValid)
     {
         db.Entry(info).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     // ViewBag.id_uzytkownik = new SelectList(db.Uzytkownik, "Id", "imie", info.id_uzytkownik);
     return(View(info));
 }
Exemple #17
0
 public ActionResult Edit([Bind(Include = "Id,UserId,ClaimType,ClaimValue")] AspNetUserClaims aspNetUserClaims)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetUserClaims).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "Email", aspNetUserClaims.UserId);
     return(View(aspNetUserClaims));
 }
Exemple #18
0
 public ActionResult Edit([Bind(Include = "VendorID,VendorName,VendorAddress")] VENDOR vENDOR)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vENDOR).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.VendorID = new SelectList(db.VENDORs, "VendorID", "MaterialID", vENDOR.VendorID);
     return(View(vENDOR));
 }
Exemple #19
0
 public ActionResult Edit([Bind(Include = "Id,Name,Model,userId,image_path,vehicle_description")] Vehicle vehicle)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vehicle).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.userId = new SelectList(db.AspNetUsers, "Id", "Email", vehicle.userId);
     return(View(vehicle));
 }
Exemple #20
0
 public ActionResult Edit([Bind(Include = "LoginProvider,ProviderKey,UserId")] AspNetUserLogins aspNetUserLogins)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetUserLogins).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "Email", aspNetUserLogins.UserId);
     return(View(aspNetUserLogins));
 }
 public ActionResult Edit([Bind(Include = "SalespersonID,SalespersonName,SalespersonTelephone,SalespersonFax,TerritoryID")] SALESPERSON sALESPERSON)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sALESPERSON).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TerritoryID = new SelectList(db.TERRITORies, "TerritoryID", "TerritoryName", sALESPERSON.TerritoryID);
     return(View(sALESPERSON));
 }
Exemple #22
0
 public ActionResult Edit([Bind(Include = "Pro_id,Pro_details,Pro_price,Pro_qty,Pro_name,Cat_Id")] product_table product_table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product_table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Cat_Id = new SelectList(db.categories_tables, "Cat_id", "Cat_name", product_table.Cat_Id);
     return(View(product_table));
 }
 public ActionResult Edit([Bind(Include = "ProductID,ProductDescription,ProductFinish,ProductStandardPrice,ProductLineID")] PRODUCT pRODUCT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pRODUCT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductLineID = new SelectList(db.PRODUCT_LINE, "ProductLineID", "ProductLineName", pRODUCT.ProductLineID);
     return(View(pRODUCT));
 }
        public ActionResult Edit([Bind(Include = "Id,CheckinDate,CheckoutDate,RoomType,HotelId,UserId,Description")] Reservation reservation)
        {

            if (ModelState.IsValid)
            {
                db.Entry(reservation).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            ViewBag.HotelId = new SelectList(db.Hotels, "Id", "Name", reservation.HotelId);
            return View(reservation);
        }
 public ActionResult Edit([Bind(Include = "EmployeeID,EmployeeName,EmployeeAddress,Supervisor")] EMPLOYEE eMPLOYEE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eMPLOYEE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.EMPLOYEEs, "EmployeeID", "EmployeeName", eMPLOYEE.EmployeeID);
     ViewBag.EmployeeID = new SelectList(db.EMPLOYEEs, "EmployeeID", "EmployeeName", eMPLOYEE.EmployeeID);
     return(View(eMPLOYEE));
 }
 public ActionResult Edit([Bind(Include = "ProductID,MaterialID,GoesIntoQuantity,UsesID")] US uS)
 {
     if (ModelState.IsValid)
     {
         db.Entry(uS).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductID  = new SelectList(db.PRODUCTs, "ProductID", "ProductDescription", uS.ProductID);
     ViewBag.MaterialID = new SelectList(db.RAWMATERIALs, "MaterialID", "MaterialName", uS.MaterialID);
     return(View(uS));
 }
 public ActionResult Edit([Bind(Include = "OrderID,OrderDate,CustomerID")] ORDER oRDER)
 {
     if (ModelState.IsValid)
     {
         db.Entry(oRDER).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID = new SelectList(db.CUSTOMERs, "CustomerID", "CustomerName", oRDER.CustomerID);
     ViewBag.OrderID    = new SelectList(db.OrderedLines, "OrderID", "ProductID", oRDER.OrderID);
     return(View(oRDER));
 }
 public ActionResult Edit([Bind(Include = "OrderID,ProductID,OrderedQuantity,OrderdedLineID")] OrderedLine orderedLine)
 {
     if (ModelState.IsValid)
     {
         db.Entry(orderedLine).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OrderID   = new SelectList(db.ORDERs, "OrderID", "CustomerID", orderedLine.OrderID);
     ViewBag.ProductID = new SelectList(db.PRODUCTs, "ProductID", "ProductDescription", orderedLine.ProductID);
     return(View(orderedLine));
 }
Exemple #29
0
 public ActionResult Edit([Bind(Include = "VendorID,MaterialID,SupplyUnitPrice, SupplyID")] SUPPLy sUPPLy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sUPPLy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaterialID = new SelectList(db.RAWMATERIALs, "MaterialID", "MaterialName", sUPPLy.MaterialID);
     ViewBag.VendorID   = new SelectList(db.VENDORs, "VendorID", "VendorName", sUPPLy.VendorID);
     return(View(sUPPLy));
 }
 public ActionResult Edit([Bind(Include = "Id,id_funkcyjna,id_klient,id_spotkanie,status")] Lista_spotkan lista_spotkan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lista_spotkan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_spotkanie = new SelectList(db.Spotkanie, "Id", "opis", lista_spotkan.id_spotkanie);
     ViewBag.id_funkcyjna = new SelectList(db.Uzytkownik, "Id", "imie", lista_spotkan.id_funkcyjna);
     ViewBag.id_klient    = new SelectList(db.Uzytkownik, "Id", "imie", lista_spotkan.id_klient);
     return(View(lista_spotkan));
 }