public IHttpActionResult PostCAS_ProductInfoVM(CAS_ProductInfoVM cAS_ProductInfoVM) { if (!ModelState.IsValid) { return BadRequest(ModelState); } try { _createProductInfo = new ProductInfoBAL(); _createProductInfo.CreateProductData(cAS_ProductInfoVM); return Ok("Product Information Created ref id - " + cAS_ProductInfoVM.Id); } catch (Exception ex) { return BadRequest(ex.Message); } return CreatedAtRoute("DefaultApi", new { id = cAS_ProductInfoVM.Id }, cAS_ProductInfoVM); }
public ActionResult SendFeedBackMail(string id) { _productInfoBAL = new ProductInfoBAL(); _cAS_ProductInfoVM = new CAS_ProductInfoVM(); _cAS_ProductInfoVM = _productInfoBAL.GetProductDataById(id); CommonClass common = new CommonClass(); common.SendMail(_cAS_ProductInfoVM.Customer_Name, _cAS_ProductInfoVM.Project_Name); _productInfoBAL = new ProductInfoBAL(); _productInfoBAL.UpdateProductInfoAfterMailSent(id); SearchVM obj = new SearchVM(); return RedirectToAction("Index", obj); }
public ActionResult GetSelectedProductInfo(string id) { _productInfoBAL = new ProductInfoBAL(); _cAS_ProductInfoVM = new CAS_ProductInfoVM(); _cAS_ProductInfoVM = _productInfoBAL.GetProductDataById(id); return PartialView("_SelectedProductInfo", _cAS_ProductInfoVM); }
// GET: ProductInfo public ActionResult Index(SearchVM obj) { _productInfoBAL = new ProductInfoBAL(); _cAS_ProductInfoVMList = new List<CAS_ProductInfoVM>(); _searchVM = new SearchVM(); _productInfoSearch = new ProductInfoSearch(); try { obj = obj ?? new SearchVM(); SearchVM objjsearch = Session["searchvm"] != null ? Session["searchvm"] as SearchVM : obj; objjsearch.PageCurrentIndex = obj.PageCurrentIndex <= 0 ? 0 : obj.PageCurrentIndex; int totalcount; _cAS_ProductInfoVMList = _productInfoBAL.GetAllProductData(objjsearch, out totalcount); _productInfoSearch.TotalCount = totalcount; _productInfoSearch.SearchExpression = objjsearch; _productInfoSearch.CAS_ProductInfoVM = _cAS_ProductInfoVMList; } catch (Exception ex) { } return View(_productInfoSearch); }