Example #1
0
        // GET: Order
        public String getOptionsValue(int optionID)
        {
            try
            {
                productRepository pr  = new productRepository(new SSMEntities());
                attributeOption   opp = pr.getProductOption(optionID);
                optionInfo        oi  = new optionInfo();
                oi.price = opp.price;
                oi.des   = opp.description;


                JavaScriptSerializer serializer = new JavaScriptSerializer();
                return(serializer.Serialize(oi));
            }
            catch (Exception e)
            {
            }

            return("");
        }
Example #2
0
        public JsonResult CreateNewOption(int attID, String optCode, String optname, String optdes, float optprice)
        {
            try
            {
                attributeOption opt = new attributeOption();
                opt.attributeID = attID;
                opt.code        = optCode;
                opt.name        = optname;
                opt.price       = optprice;
                opt.description = optdes;
                productRepository se = new productRepository(new SSMEntities());
                se.insertNewOption(opt);

                return(Json(new { result = "true" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
            }
            return(Json(new { result = "false" }, JsonRequestBehavior.AllowGet));
        }
Example #3
0
 public void insertNewOption(attributeOption opt)
 {
     context.attributeOptions.Add(opt);
     context.SaveChanges();
 }