/// <summary> /// update existing student info /// </summary> /// <param name="s"></param> public static void UpdateProduct(PLProduct s) { SLProduct.ProductInfo newProduct = DTO_to_SL_Product(s); SLProduct.ISLProduct SLProduct = new SLProduct.SLProductClient(); string[] errors = new string[0]; SLProduct.UpdateProduct(newProduct.product_id, newProduct.product_name, ref errors); }
public ActionResult Edit(int id) { SLProduct.ProductInfo Product = this.ProductList.GetProductDetail(id - 1); PLProduct plProduct = ProductClientService.DTO_to_PL_Product(Product); return(View("Edit", plProduct)); }
/// <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 PLProduct DTO_to_PL_Product(SLProduct.ProductInfo Product) { PLProduct PLProduct = new Models.PLProduct(); PLProduct.Product_id = Product.product_id; PLProduct.product_name = Product.product_name; return(PLProduct); }
/// <summary> /// Get student detail /// </summary> /// <param name="id"></param> /// <returns></returns> public static PLProduct ReadProductDetail(int id) { SLProduct.ISLProduct SLProduct = new SLProduct.SLProductClient(); string[] errors = new string[0]; SLProduct.ProductInfo newProduct = SLProduct.ReadProduct(id, ref errors); // this is the data transfer object code... return(DTO_to_PL_Product(newProduct)); }