Example #1
0
        public JsonResult CreateNewMarketPlan(int productID, String planName, float price, float floorPrice, float ceilPrice, String optionIds, String newMarketPlanDes)
        {
            try
            {
                productMarketPlan att = new productMarketPlan();
                att.Name        = planName;
                att.productID   = productID;
                att.Description = newMarketPlanDes;
                att.Price       = price;
                att.floorprice  = floorPrice;
                att.ceilPrice   = ceilPrice;
                att.isActive    = true;
                att.operating   = false;
                att.CreatedDay  = DateTime.Today;
                string[]          ids = optionIds.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                productRepository se  = new productRepository(new SSMEntities());
                se.insertNewMarketPlan(att, ids);

                return(Json(new { result = "true" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
            }
            return(Json(new { result = "false" }, JsonRequestBehavior.AllowGet));
        }