public ActionResult Create([Bind(Include = "ID,Name,Description,Notes")] WorkOrderStatu workOrderStatu)
        {
            if (ModelState.IsValid)
            {
                db.WorkOrderStatus.Add(workOrderStatu);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(workOrderStatu));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "ID,Name,contactName,contactMobile,contactEmail,Notes")] Contractor contractor)
        {
            if (ModelState.IsValid)
            {
                db.Contractors.Add(contractor);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(contractor));
        }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "parameterNameID,parameterNameName")] ParameterName parameterName)
        {
            if (ModelState.IsValid)
            {
                db.ParameterNames.Add(parameterName);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(parameterName));
        }
        public ActionResult Create([Bind(Include = "workorderTypeID,workorderTypeName")] WorkorderType workorderType)
        {
            if (ModelState.IsValid)
            {
                db.WorkorderTypes.Add(workorderType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(workorderType));
        }
Beispiel #5
0
        public ActionResult Create([Bind(Include = "ID,Name,Description,Notes,dateTimeStamp")] Project project)
        {
            if (ModelState.IsValid)
            {
                db.Projects.Add(project);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(project));
        }
Beispiel #6
0
        public ActionResult Create([Bind(Include = "ID,unitType,unitMesurment,Notes,Distance")] ParametersUnitType parametersUnitType)
        {
            if (ModelState.IsValid)
            {
                db.ParametersUnitTypes.Add(parametersUnitType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(parametersUnitType));
        }
        public ActionResult Create([Bind(Include = "ID,Name,Description,Notes")] Location location)
        {
            if (ModelState.IsValid)
            {
                db.Locations.Add(location);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(location));
        }
Beispiel #8
0
        public ActionResult Create([Bind(Include = "ID,Name,Description,Notes")] VoltageLevel voltageLevel)
        {
            if (ModelState.IsValid)
            {
                db.VoltageLevels.Add(voltageLevel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(voltageLevel));
        }
Beispiel #9
0
        public ActionResult Create([Bind(Include = "ID,Name,Description,Notes")] ParemeterCalcGroup paremeterCalcGroup)
        {
            if (ModelState.IsValid)
            {
                db.ParemeterCalcGroups.Add(paremeterCalcGroup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(paremeterCalcGroup));
        }
Beispiel #10
0
        public ActionResult Create([Bind(Include = "ID,Name,userName,Password,token,isActive,SuperVisor,role,modirate,regon")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.SuperVisor = new SelectList(db.Users, "ID", "Name", user.SuperVisor);
            return(View(user));
        }
        public ActionResult Create([Bind(Include = "ID,Name,Description,Notes,workorderTypeID_FK")] ParameterCategory parameterCategory)
        {
            if (ModelState.IsValid)
            {
                db.ParameterCategories.Add(parameterCategory);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.workorderTypeID_FK = new SelectList(db.WorkorderTypes, "workorderTypeID", "workorderTypeName", parameterCategory.workorderTypeID_FK);
            return(View(parameterCategory));
        }
Beispiel #12
0
        public ActionResult Create([Bind(Include = "ID,workOrder_FKID,parameter_FKID,Lenght,Amount,isDone,lastUpdate,DoneLength,DoneAmount,weightAmount")] WorkOrdersParameter workOrdersParameter)
        {
            if (ModelState.IsValid)
            {
                db.WorkOrdersParameters.Add(workOrdersParameter);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.parameter_FKID = new SelectList(db.Parameters, "ID", "Name", workOrdersParameter.parameter_FKID);
            ViewBag.workOrder_FKID = new SelectList(db.WorkOrders, "ID", "Number", workOrdersParameter.workOrder_FKID);
            return(View(workOrdersParameter));
        }
        public ActionResult Create([Bind(Include = "ID,Name,Description,parameterCategory_FKID,parameterCalcGroup_FKID,ParameterWight,parameterUnitType_FKID,networkType_FKID,isActive,isRquired,parameterNameID_FK")] Parameter parameter)
        {
            if (ModelState.IsValid)
            {
                db.Parameters.Add(parameter);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.parameterCategory_FKID  = new SelectList(db.ParameterCategories, "ID", "Name", parameter.parameterCategory_FKID);
            ViewBag.parameterNameID_FK      = new SelectList(db.ParameterNames, "parameterNameID", "parameterNameName", parameter.parameterNameID_FK);
            ViewBag.parameterUnitType_FKID  = new SelectList(db.ParametersUnitTypes, "ID", "unitType", parameter.parameterUnitType_FKID);
            ViewBag.parameterCalcGroup_FKID = new SelectList(db.ParemeterCalcGroups, "ID", "Name", parameter.parameterCalcGroup_FKID);
            return(View(parameter));
        }
Beispiel #14
0
        public ActionResult Create([Bind(Include = "ID,Number,project_FKID,location_FKID,contractors_FKID,ParameterCategory_FKID,totalLenght,voltageLevels_FKID,startingDate,maxDueDays,dateTimeStamp,workOrderStatus_FKID,user_FKID,value")] WorkOrder workOrder)
        {
            if (ModelState.IsValid)
            {
                db.WorkOrders.Add(workOrder);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.contractors_FKID       = new SelectList(db.Contractors, "ID", "Name", workOrder.contractors_FKID);
            ViewBag.location_FKID          = new SelectList(db.Locations, "ID", "Name", workOrder.location_FKID);
            ViewBag.ParameterCategory_FKID = new SelectList(db.ParameterCategories, "ID", "Name", workOrder.ParameterCategory_FKID);
            ViewBag.project_FKID           = new SelectList(db.Projects, "ID", "Name", workOrder.project_FKID);
            ViewBag.user_FKID            = new SelectList(db.Users, "ID", "Name", workOrder.user_FKID);
            ViewBag.voltageLevels_FKID   = new SelectList(db.VoltageLevels, "ID", "Name", workOrder.voltageLevels_FKID);
            ViewBag.workOrderStatus_FKID = new SelectList(db.WorkOrderStatus, "ID", "Name", workOrder.workOrderStatus_FKID);
            return(View(workOrder));
        }