Ejemplo n.º 1
0
        public ValueUnit(string name, UnitMathType type, int mathNum, int?parentId)
        {
            this.Name     = name;
            this.MathType = type;
            this.MathNum  = mathNum;
            this.ParentId = parentId;

            this.Childeren = new List <ValueUnit>();
            //this.DesciplineLink = new List<ValueUnitDescipline>();
            this.Activityes = new List <Activity>();
        }
Ejemplo n.º 2
0
        public IStatusGeneric UpdateValueUnit(string name, UnitMathType type, int mathNum)
        {
            var status = new StatusGenericHandler();

            if (string.IsNullOrWhiteSpace(name))
            {
                status.AddError("I'm sorry, but name is empty.");
                return(status);
            }

            //All Ok
            this.Name     = name;
            this.MathType = MathType;
            this.MathNum  = mathNum;
            return(status);
        }
Ejemplo n.º 3
0
        public static IStatusGeneric <ValueUnit> CreateValueUnit(string name, UnitMathType type, int mathNum, int?parentId)
        {
            var status    = new StatusGenericHandler <ValueUnit>();
            var valueUnit = new ValueUnit
            {
                Name     = name,
                MathType = type,
                MathNum  = mathNum,
                ParentId = parentId
            };

            //valueUnit.DesciplineLink = new List<ValueUnitDescipline>();
            //foreach (var ids in desciplineId)
            //{
            //    valueUnit.DesciplineLink.Add(ValueUnitDescipline.CreateValueUnitDescipline(0,ids).Result);
            //}

            status.Result = valueUnit;
            return(status);
        }