public ActionResult AddProductionQCDetail(bool update) { ProductionQCDetailViewModel productionQCDetailVM = new ProductionQCDetailViewModel(); productionQCDetailVM.IsUpdate = update; return(PartialView("_AddProductionQCDetail", productionQCDetailVM)); }
public string GetProductionQCDetailListByProductionQCID(Guid productionQCID) { try { List <ProductionQCDetailViewModel> productionQCItemViewModelList = new List <ProductionQCDetailViewModel>(); if (productionQCID == Guid.Empty) { ProductionQCDetailViewModel productionQCDetailVM = new ProductionQCDetailViewModel() { ID = Guid.Empty, ProdQCID = Guid.Empty, ProductID = Guid.Empty, ProductModelID = Guid.Empty, ProductSpec = string.Empty, QCQty = 0, QCDate = _pSASysCommon.GetCurrentDateTime(), QCDateFormatted = _pSASysCommon.GetCurrentDateTime().ToString("dd-MMM-yyyy"), Product = new ProductViewModel() { ID = Guid.Empty, Code = string.Empty, Name = string.Empty, }, ProductModel = new ProductModelViewModel() { ID = Guid.Empty, Name = string.Empty }, }; productionQCItemViewModelList.Add(productionQCDetailVM); } else { productionQCItemViewModelList = Mapper.Map <List <ProductionQCDetail>, List <ProductionQCDetailViewModel> >(_productionQCBusiness.GetProductionQCDetailListByProductionQCID(productionQCID)); } return(JsonConvert.SerializeObject(new { Status = "OK", Records = productionQCItemViewModelList, Message = "Success" })); } catch (Exception ex) { AppConstMessage cm = _appConstant.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Status = "ERROR", Records = "", Message = cm.Message })); } }