Esempio n. 1
0
        public Employee GetByIdDetached(int id)
        {
            var empl = db.Employees.Find(id);

            db.Entry(empl).State = EntityState.Detached;
            return(empl);
        }
        public DepartmentEmployee GetByIdDetached(int id)
        {
            var depEmpl = db.DepartmentsEmployees.Find(id);

            db.Entry(depEmpl).State = EntityState.Detached;
            return(depEmpl);
        }
        public Department GetByIdDetached(int id)
        {
            var dep = db.Departments.Find(id);

            db.Entry(dep).State = EntityState.Detached;
            return(dep);
        }
Esempio n. 4
0
        public EmplTask GetByIdDetached(int id)
        {
            var task = db.Tasks.Find(id);

            db.Entry(task).State = EntityState.Detached;
            return(task);
        }
 public ActionResult Edit([Bind(Include = "Id,Name,Details")] Exam badanie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(badanie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(badanie));
 }
Esempio n. 6
0
        public ActionResult EditWO([Bind(Include = "Order_ID, Cust_ID, Invoice_ID, Date_Created, Date_Completed, Order_Status, WO_Discount, Expedite_Order, Test2_IfActive, Test2_IfInactive, Analysis, Analysis_Completed")] WorkOrders wo)
        {
            if (ModelState.IsValid)
            {
                //add entry
                //db.WorkOrders.Add(wo);
                //edit entries
                db.Entry(wo).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("WorkOrders"));
            }

            return(View(wo));
        }
Esempio n. 7
0
 public ActionResult Edit([Bind(Include = "Teachers_id,Teachers_name,Teachers_age,Teachers_level,Teachers_phone,Kafedra_id")] Teachers teachers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teachers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(teachers));
 }
 public ActionResult Edit([Bind(Include = "LTNumber,CustomerID,CompoundName,MillQuant,Active,Comments,QuantitativeFileType,QualitativeResults,QuantitativeResults,MTD")] Compound compound)
 {
     if (ModelState.IsValid)
     {
         db.Entry(compound).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(compound));
 }
 public ActionResult Edit([Bind(Include = "OrderID,LTNumber,CustomerID,OrderTotal,DateArrived,ReceivedBy,DueDate,Quote,Discount,CurrentCost,ConfirmationSentDate,SummaryReport")] WorkOrder workOrder)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workOrder).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(workOrder));
 }
Esempio n. 10
0
 public ActionResult Edit([Bind(Include = "Instytyts_id,Instytyts_name,Director")] Instutyt instutyt)
 {
     if (ModelState.IsValid)
     {
         db.Entry(instutyt).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(instutyt));
 }
Esempio n. 11
0
 public ActionResult Edit([Bind(Include = "Kafedra_id,Kafedra_name,Kafedra_zav,Count_Doctor_Science,Instytyts_id")] Kafedra kafedra)
 {
     if (ModelState.IsValid)
     {
         db.Entry(kafedra).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(kafedra));
 }
Esempio n. 12
0
 public ActionResult Edit([Bind(Include = "CityId,CityName,Population,ProvinceId")] City city)
 {
     if (ModelState.IsValid)
     {
         db.Entry(city).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(city));
 }
Esempio n. 13
0
 public ActionResult Edit([Bind(Include = "Subject_id,Subject_name,Subject_hour,Subject_Type_Ex")] Subjects subjects)
 {
     if (ModelState.IsValid)
     {
         db.Entry(subjects).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(subjects));
 }
 public ActionResult Edit([Bind(Include = "AssayID,TypeCode,SummaryInfo,DetailedInfo,Procedure,LiteratureReferences,EstimateDaysToComplete")] Assay assay)
 {
     if (ModelState.IsValid)
     {
         db.Entry(assay).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(assay));
 }
Esempio n. 15
0
 public ActionResult Edit([Bind(Include = "CustomerID,FirstName,LastName,Address,City,State,Zip,Email,Password,Phone,AdvanceMoney")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Esempio n. 16
0
        public ActionResult EditCustomer([Bind(Include = "Cust_ID, Cust_First_Name, Cust_Last_Name, Cust_Address, Cust_City, Cust_State, Cust_Country, Cust_Zip, Cust_Email, Cust_Password, Cust_Phone, Account_Created_Date, Cust_Discount")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                //add entry
                // db.Customers.Add(customer); 
                //edit entries
                db.Entry(customer).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(customer);
        }
 public ActionResult Edit(
     [Bind(
          Include =
              "Id,Email,PhoneNumber,UserName"
          )] ApplicationUser applicationUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(applicationUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(applicationUser));
 }
        public ActionResult Edit([Bind(Include = "LT_Number, Assay_ID, Order_ID, Date_Arrived, Date_Processed, Date_Due, Compound_Weight_Client, Actual_Weight, Molecular_Mass")] Compound_Samples cs)
        {
            if (ModelState.IsValid)
            {
                //add entry
                //db.Compound_Samples.Add(cs);
                //edit entries
                db.Entry(cs).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Message = "Error in validation";
            return(View(cs));
        }
 public ActionResult Edit(PatientEditViewModel pacjent)
 {
     if (ModelState.IsValid)
     {
         var newData = new Patient()
         {
             ID       = pacjent.ID,
             LastName = pacjent.LastName,
             Name     = pacjent.Name
         };
         db.Entry(newData).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pacjent));
 }
 public void Update(TEntity e)
 {
     db.Entry(e).State = EntityState.Modified;
     db.SaveChanges();
 }