private MaterialReturnModel ConvertToModelMVC(MaterialReturnWEBAPI materialReturn) { MaterialReturnModel materialReturnWEBAPI = new MaterialReturnModel(); materialReturnWEBAPI.ActPartNum = materialReturn.ActPartNum; materialReturnWEBAPI.BalQty = materialReturn.BalQty; materialReturnWEBAPI.Company = materialReturn.Company; materialReturnWEBAPI.CreatedBy = materialReturn.CreatedBy; materialReturnWEBAPI.Desc = materialReturn.Desc; materialReturnWEBAPI.FromBin = materialReturn.FromBin; materialReturnWEBAPI.FromWH = materialReturn.FromWH; materialReturnWEBAPI.Lot = materialReturn.Lot; materialReturnWEBAPI.PartNum = materialReturn.PartNum; materialReturnWEBAPI.Qty = materialReturn.Qty; materialReturnWEBAPI.Reason = materialReturn.Reason; materialReturnWEBAPI.RetReason = materialReturn.RetReason; materialReturnWEBAPI.SupplierPart = materialReturn.SupplierPart; materialReturnWEBAPI.TranStatus = materialReturn.TranStatus; materialReturnWEBAPI.UOM = materialReturn.UOM; return(materialReturnWEBAPI); }
public ActionResult ValidateLot(MaterialReturnModel obj) { MaterialReturnWEBAPI objSend = new MaterialReturnWEBAPI(); objSend = ConvertToModelAPI(obj); string msg = string.Empty; MaterialReturnWEBAPI objReturn = new MaterialReturnWEBAPI(); HttpResponseMessage response = GlobalVariables.WebApiClient.PostAsJsonAsync("RetnMaterialValidateLot", objSend).Result; objReturn = response.Content.ReadAsAsync <MaterialReturnWEBAPI>().Result; MaterialReturnModel objMVC = new MaterialReturnModel(); objMVC = ConvertToModelMVC(objReturn); if (objReturn.TranStatus != "Success") { msg = objReturn.TranStatus; return(Json(new { Message = msg }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { Data = objMVC }, JsonRequestBehavior.AllowGet)); } }