public ActionResult UpdateFactory(Factory11 factory) { int uId = Convert.ToInt32(Session["UserId"].ToString()); ObjectParameter statusCode = new ObjectParameter("StatusCode", typeof(int)); ObjectParameter statusMessage = new ObjectParameter("StatusMessage", typeof(string)); db.AddUpdateFactory(factory.Id, factory.Name, factory.Type, factory.ProductionCapacity, factory.DailyProductionRate, factory.NumberofMixers, factory.NumberofTrucks, factory.PhoneNumber, factory.FaxNumber, factory.MailBox, factory.Email, factory.Status, factory.Latitude, factory.Longitude, factory.Location, factory.OwnerName, factory.OwnerEmail, factory.OwnerPhoneNumber, factory.ManagerName, factory.ManagerEmail, factory.ManagerPhoneNumber, factory.ManagerExperience, factory.EngineerName, factory.EngineerEmail, factory.EngineerPhoneNumber, factory.EngineerExperience, factory.Comments, null, factory.CreatedBy, factory.CreatedDate, uId, null, statusCode, statusMessage); if (factory.Status == "Approved") { TempData["AlertMessage"] = "Approved"; } else { TempData["AlertMessage"] = "Rejected"; } return(RedirectToAction("FactoriesList", "Factory", new { id = 1 })); }
public ActionResult CreateFactory(Factory11 factory) { ObjectParameter statusCode = new ObjectParameter("StatusCode", typeof(int)); ObjectParameter statusMessage = new ObjectParameter("StatusMessage", typeof(string)); db.AddUpdateFactory(0, factory.Name, factory.Type, factory.ProductionCapacity, factory.DailyProductionRate, factory.NumberofMixers, factory.NumberofTrucks, factory.PhoneNumber, factory.FaxNumber, factory.MailBox, factory.Email, factory.Status, factory.Latitude, factory.Longitude, factory.OwnerName, factory.OwnerEmail, factory.OwnerPhoneNumber, factory.ManagerName, factory.ManagerEmail, factory.ManagerPhoneNumber, factory.ManagerExperience, factory.EngineerName, factory.EngineerEmail, factory.EngineerPhoneNumber, factory.EngineerExperience, factory.Comments, null, null, null, null, null, statusCode, statusMessage); return(View("FactoriesList")); }
public ActionResult Create([Bind(Include = "laboTechStaff,ProductQuality,FactoryWarnings,ProceduresRequired,FactoryId")] TechnicalReport technicalReport) { if (ModelState.IsValid) { Factory11 factory = db.Factory11.Find(technicalReport.FactoryId); technicalReport.FactoryName = factory.Name; db.TechnicalReports.Add(technicalReport); technicalReport.Approval = "Draft"; technicalReport.CreationDate = DateTime.Now; db.SaveChanges(); return(RedirectToAction("Home", "Home", new { id = 1 })); } ViewBag.FactoryId = new SelectList(db.Factory11, "Id", "Name", technicalReport.FactoryId); return(View(technicalReport)); }
public ActionResult Create(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Factory11 factory = db.Factory11.Find(id); if (factory == null) { return(HttpNotFound()); } ViewBag.FactoryId = factory.Id; TechnicalReport vm = new TechnicalReport() { FactoryId = factory.Id }; return(View(vm)); }
// GET: Factory/Details/5 public ActionResult FactoryDetails(int id) { Factory11 factory = db.Factory11.Where(u => u.Id == id).FirstOrDefault(); return(PartialView(factory)); }