/// <summary>
        /// update existing student info
        /// </summary>
        /// <param name="s"></param>
        public static void UpdateProductVariation(PLProductVariation s)
        {
            SLProductVariation.ProductVariationInfo newProductVariation = DTO_to_SL(s);

            SLProductVariation.ISLProductVariation SLProductVariation = new SLProductVariation.SLProductVariationClient();
            string[] errors = new string[0];
            SLProductVariation.UpdatePV(newProductVariation, ref errors);
        }
Exemple #2
0
        public ActionResult Details(int id)
        {
            SLProductVariation.ProductVariationInfo pv = this.pvList.GetPVDetail(id - 1);

            PLProductVariation plpv = ProductVariationClientService.DTO_to_PL(pv);

            return(View("Details", plpv));
        }
        /// <summary>
        /// Get student detail
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static PLProductVariation ReadProductVariationDetail(int id)
        {
            SLProductVariation.ISLProductVariation SLProductVariation = new SLProductVariation.SLProductVariationClient();

            string[] errors = new string[0];
            SLProductVariation.ProductVariationInfo newProductVariation = SLProductVariation.ReadPV(id, ref errors);

            // this is the data transfer object code...
            return(DTO_to_PL(newProductVariation));
        }
Exemple #4
0
        public ActionResult Edit(int id)
        {
            SLProductVariation.ProductVariationInfo pv = this.pvList.GetPVDetail(id);

            PLProductVariation plpv = ProductVariationClientService.DTO_to_PL(pv);

            AllProductInfo api = new AllProductInfo();

            api.pvList[0] = plpv;

            return(View("Edit", api));
        }
        /// <summary>
        /// This is the data transfer object for student.
        /// Converting business layer student object to presentation layer student object
        /// </summary>
        /// <param name="student"></param>
        /// <returns></returns>
        public static PLProductVariation DTO_to_PL(SLProductVariation.ProductVariationInfo pv)
        {
            PLProductVariation PLProductVariation = new Models.PLProductVariation();

            PLProductVariation.pv_id              = pv.product_variation_id;
            PLProductVariation.product_id         = pv.product_id;
            PLProductVariation.brand_id           = pv.product_brand_id;
            PLProductVariation.product_color_id   = pv.product_color_id;
            PLProductVariation.product_cutting_id = pv.product_cutting_id;
            PLProductVariation.product_type_id    = pv.product_type_id;
            PLProductVariation.sex       = pv.sex;
            PLProductVariation.size      = pv.size;
            PLProductVariation.stock     = pv.stock;
            PLProductVariation.price     = pv.stock;
            PLProductVariation.condition = pv.condition;

            return(PLProductVariation);
        }