public ActionResult ChangeRAM(cRAM ram, int?quantity, string image)
        {
            CRUDService.ServiceClient sr = new CRUDService.ServiceClient();
            PartsStock part = new PartsStock();

            if (quantity != null)
            {
                part.Quantity = (int)quantity;
            }
            else
            {
                part.Quantity = sr.getPart(ram.id).Quantity;
            }
            if (image != null && image != "")
            {
                part.Image = image;
            }
            else
            {
                part.Image = sr.getPart(ram.id).image;
            }
            bool done = sr.EditRAM(ram, part, ram.id);

            if (done)
            {
                return(this.Redirect(Url.Action("Complete", "EditProduct")));
            }
            else
            {
                return(this.Redirect(Url.Action("RAM", "EditProduct")));
            }
        }
        public ActionResult RAM(int id)
        {
            CRUDService.ServiceClient sr = new CRUDService.ServiceClient();
            cRAM part = sr.getRAM(id);

            return(View(part));
        }
示例#3
0
        public ActionResult RAM()
        {
            if (Convert.ToInt32(Session["UserType"]) != 1 && Convert.ToInt32(Session["UserType"]) != 3)
            {
                return(this.Redirect(@Url.Action("Index", "Home")));
            }
            cRAM part = new cRAM
            {
                active = 0
            };

            return(View(part));
        }
示例#4
0
        public ActionResult addRAM(cRAM part, string image)
        {
            if (Convert.ToInt32(Session["UserType"]) != 1 && Convert.ToInt32(Session["UserType"]) != 3)
            {
                return(this.Redirect(@Url.Action("Index", "Home")));
            }
            CRUDService.ServiceClient sr = new CRUDService.ServiceClient();
            bool added = sr.addRAM(part, 1, image);

            if (added)
            {
                return(this.Redirect(Url.Action("Complete", "AddNewProduct")));
            }
            else
            {
                return(this.Redirect(Url.Action("RAM", "AddNewProduct")));
            }
        }