public ActionResult GetMechanicalMetal(int materialId, int sourceMaterialId, int sourceId, int subgroupId, int groupId, string searchText, int type, int conditionId = 0)
        {
            if (type == 2)
            {
                type = 1;
            }

            if (type == 3)
            {
                type = 2;
            }

            IService     service     = new TotalMateriaService();
            IPlusService servicePLUS = new TMPlusService();

            string sessionId = System.Web.HttpContext.Current.Session["TotalMateriaSession"].ToString();

            ConditionModel conditionData = new ConditionModel();
            Condition      cond          = new ConditionTMMetalsBinder().FillMechanicalConditionData(subgroupId, sourceMaterialId, conditionId, materialContextUow, type, sessionId);

            conditionData.ConditionId    = cond.ConditionId;
            conditionData.ConditionName  = cond.ConditionName;
            conditionData.Properties     = cond.Properties;
            conditionData.ProductGroupId = ProductGroup.ProductGroupType.Mechanical;
            //TODO: Fill references
            conditionData.SelectedReferences = null;

            return(Json(ResponseStatus.Success, RenderPartialViewToString("ConditionPropertiesContent", conditionData), JsonRequestBehavior.AllowGet));
        }
        public ProductGroup FillPhysicalGroup(int subgroupId, int sourceMaterialId, string sessionId, IMaterialsContextUow context, IService service, int type)
        {
            IList <ConditionModel> physicalConditionsGlobal = new List <ConditionModel>();

            IList <Condition> physicalConditions = service.GetPhysicalPropertiesFromService(sessionId, sourceMaterialId).OrderBy(m => m.ConditionName).ToList();

            foreach (var physicalCondition in physicalConditions)
            {
                IList <Property> physicalProperties = new ConditionTMMetalsBinder().FillPhysicalConditionData(context, type, physicalCondition);
                IList <string>   selectedReferences = service.GetReferencesForSelectedConditionFromService(sessionId, sourceMaterialId, physicalCondition.ConditionId, MaterialDetailType.PhysicalProperties);

                physicalConditionsGlobal.Add(new ConditionModel()
                {
                    ConditionId = physicalCondition.ConditionId, SelectedReferences = selectedReferences, ConditionName = physicalCondition.ConditionName, Properties = physicalProperties
                });
            }

            if (physicalConditions.Count > 0)
            {
                //string nameP = context.PreferredNames.Find(p => p.PN_ID == (int)ProductGroup.ProductGroupType.Physical).PN;
                //propertiesGroups.Add(ProductGroup.ProductGroupType.Physical, new ProductGroup() { ProductGroupId = ProductGroup.ProductGroupType.Physical, ProductGroupName = nameP, Conditions = chemcialConditionsGlobal, ConditionId = chemcialConditionsGlobal[0].ConditionId, PropertyCount = tempCount });
                ProductGroup propertyGroup = FillPropertyGroup(physicalConditionsGlobal, ProductGroup.ProductGroupType.Physical, context);
                return(propertyGroup);
            }

            return(null);
        }
        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));
        }
예제 #4
0
        public ComparisonMaterialBinder()
        {
            _binderEls              = new ComparisonELSBinder();
            _binderTM               = new ComparisonTMBinder();
            _binderMaterial         = new MaterialBinder();
            _binderPropertyEls      = new PropertyElsBinder();
            _binderPropertyTMMetals = new PropertyTMMetalsBinder();
            _binderPropertyTMPlus   = new PropertyTMPlusBinder();
            _binderProperty         = new PropertyBinder();

            _binderConditionTMPlus   = new ConditionTMPlusBinder();
            _binderConditionTMMetals = new ConditionTMMetalsBinder();
        }