public ActionResult Create([Bind(Include = "idQuotation,DateCompleted,Quantity,State,TypeQuotation,incidentals,Transport,TotalLabor,CustomerValue,TotalProduction")] Quotation quotation)
        {
            if (ModelState.IsValid)
            {
                db.Quotations.Add(quotation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(quotation));
        }
示例#2
0
        public ActionResult Create([Bind(Include = "idPublication,PublicationName,Cost,PublicationDate,State,Height,Width,Depth")] Publication publication)
        {
            if (ModelState.IsValid)
            {
                db.Publications.Add(publication);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(publication));
        }
示例#3
0
        public ActionResult Create([Bind(Include = "IDMEDIDATIPO,Nombre")] MedidaTipo medidaTipo)
        {
            if (ModelState.IsValid)
            {
                db.MedidaTipoes.Add(medidaTipo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(medidaTipo));
        }
示例#4
0
        public ActionResult Create([Bind(Include = "IDDocumentType,DocumentTypeName")] DocumentType documentType)
        {
            if (ModelState.IsValid)
            {
                db.DocumentTypes.Add(documentType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(documentType));
        }
示例#5
0
        public ActionResult Create([Bind(Include = "IDUserType,UserTypeName")] UserType userType)
        {
            if (ModelState.IsValid)
            {
                db.UserTypes.Add(userType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(userType));
        }
示例#6
0
        public ActionResult Create([Bind(Include = "idSuplier,SuplierName,IdCity")] Supplier supplier)
        {
            if (ModelState.IsValid)
            {
                db.Suppliers.Add(supplier);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.IdCity = new SelectList(db.Cities, "IdCity", "CityName", supplier.IdCity);
            return(View(supplier));
        }
        public ActionResult Create([Bind(Include = "idSupplie,SupplieName,idSuplier,IDMEDIDATIPO")] Supplie supplie)
        {
            if (ModelState.IsValid)
            {
                db.Supplies.Add(supplie);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.IDMEDIDATIPO = new SelectList(db.MedidaTipoes, "IDMEDIDATIPO", "Nombre", supplie.IDMEDIDATIPO);
            ViewBag.idSuplier    = new SelectList(db.Suppliers, "idSuplier", "SuplierName", supplie.idSuplier);
            return(View(supplie));
        }
示例#8
0
        public ActionResult Create(DetailViews view)
        {
            if (ModelState.IsValid)
            {
                var pic    = string.Empty;
                var folder = "~/Content/Image";

                if (view.ImageFile != null)
                {
                    pic = FileHelper.uploadphoto(view.ImageFile, folder);
                    pic = string.Format("{0}/{1}", folder, pic);
                }

                var detail = ToDetail(view);
                detail.Image = pic;

                db.Details.Add(detail);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(view));
        }