public ActionResult GetPhysicalMetal(int materialId, int sourceMaterialId, int sourceId, int subgroupId, int groupId, int conditionId, string searchText, int type) { if (type == 2) { type = 1; } if (type == 3) { type = 2; } string sessionId = System.Web.HttpContext.Current.Session["TotalMateriaSession"].ToString(); ConditionModel conditionData = new ConditionModel(); Condition cond = new ConditionTMMetalsBinder().FillPhysicalConditionData(sourceMaterialId, conditionId, materialContextUow, type, sessionId); conditionData.ConditionId = cond.ConditionId; conditionData.ConditionName = cond.ConditionName; conditionData.Properties = cond.Properties; conditionData.ProductGroupId = ProductGroup.ProductGroupType.Physical; IService service = new TotalMateriaService(); conditionData.SelectedReferences = service.GetReferencesForSelectedConditionFromService(sessionId, sourceMaterialId, cond.ConditionId, MaterialDetailType.PhysicalProperties); return(Json(ResponseStatus.Success, RenderPartialViewToString("ConditionPropertiesContent", conditionData), JsonRequestBehavior.AllowGet)); }
public Condition FillPhysicalConditionData(int sourceMaterialId, int conditionId, IMaterialsContextUow context, int unitType, string sessionId) { IService service = new TotalMateriaService(); Condition condition = new Condition(); condition.Properties = new List <Property>(); Condition physicalCondition = service.GetPhysicalPropertiesFromService(sessionId, sourceMaterialId).Where(m => m.ConditionId == conditionId).FirstOrDefault(); condition.Properties = new ConditionTMMetalsBinder().FillPhysicalConditionData(context, unitType, physicalCondition); condition.ConditionId = conditionId; for (int i = 0; i < condition.Properties.ToList().Count; i++) { condition.Properties[i].ValueId = i; } condition.ConditionName = physicalCondition.ConditionName; IList <string> selectedReferences = service.GetReferencesForSelectedConditionFromService(sessionId, sourceMaterialId, physicalCondition.ConditionId, MaterialDetailType.PhysicalProperties); return(condition); }