Example #1
0
        public ActionResult Detail(int id)
        {
            productRepository pr = new productRepository(new SSMEntities());

            try
            {
                softwareProduct product = pr.getById(id);
                if (product != null)
                {
                    List <double>   totalvalues = new List <double>();
                    ProductServices ps          = new ProductServices();
                    for (int i = 0; i < 12; i++)
                    {
                        totalvalues.Add(ps.getMonthValues(i, product.id));
                        System.Diagnostics.Debug.WriteLine("added " + ps.getMonthValues(i, product.id));
                    }
                    ViewData["productDetail"] = product;

                    ViewData["productperformance"] = totalvalues;
                    return(View("ProductDescription"));
                }
            }
            catch (Exception e)
            {
            }
            return(RedirectToAction("Index"));
        }
Example #2
0
        public ActionResult NewDeal(Deal newdeal, String responsiblesRole, int planID)
        {
            productRepository pr = new productRepository(new SSMEntities());

            ViewData["AllProductDetail"] = pr.getAll();
            return(View("CreateDeal"));
        }
Example #3
0
        public ActionResult getProductAttribute(int productID)
        {
            productRepository pr = new productRepository(new SSMEntities());

            ViewData["ProductDetail"] = pr.getById(productID);
            return(PartialView("TableOptionDetail"));
        }
Example #4
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));
        }
Example #5
0
        public JsonResult CreateNewAtt(int productID, String attname, String attcode, String attdes)
        {
            try
            {
                productAttribute att = new productAttribute();
                att.name        = attname;
                att.productID   = productID;
                att.code        = attcode;
                att.description = attcode;
                productRepository se = new productRepository(new SSMEntities());
                se.insertNewAttribute(att);

                return(Json(new { result = "true" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
            }
            return(Json(new { result = "false" }, JsonRequestBehavior.AllowGet));
        }
Example #6
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 #7
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 #8
0
        public String getAllProduct()
        {
            try {
                productRepository      pr   = new productRepository(new SSMEntities());
                List <softwareProduct> lst  = pr.getAll();
                List <ProductInfo>     lst2 = new List <ProductInfo>();
                foreach (softwareProduct so in lst)
                {
                    ProductInfo pi = new ProductInfo();
                    pi.name = so.name;
                    pi.id   = so.id;
                    lst2.Add(pi);
                }


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

            return("");
        }
Example #9
0
 // GET: Product
 public ProductController()
 {
     pr = new productRepository(new SSMEntities());
 }
Example #10
0
 public ShopController()
 {
     pmngr = new productRepository(new Areas.Admin.Models.AppDbContext.Context());
 }
Example #11
0
 public productController()
 {
     mngr  = new productRepository(new Models.AppDbContext.Context());
     bmngr = new brandRepository(new Models.AppDbContext.Context());
     cmngr = new categoryRepository(new Models.AppDbContext.Context());
 }