コード例 #1
0
		public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
		{
			WfMatrixDimensionDefinition matrixDimensionDefinition = new WfMatrixDimensionDefinition();

			matrixDimensionDefinition.DataType = DictionaryHelper.GetValue(dictionary, "DataType", PropertyDataType.String);
			matrixDimensionDefinition.Description = DictionaryHelper.GetValue(dictionary, "Description", string.Empty);
			matrixDimensionDefinition.DimensionKey = DictionaryHelper.GetValue(dictionary, "DimensionKey", string.Empty);
			matrixDimensionDefinition.MatrixKey = DictionaryHelper.GetValue(dictionary, "MatrixKey", string.Empty);
			matrixDimensionDefinition.Name = DictionaryHelper.GetValue(dictionary, "Name", string.Empty);
			matrixDimensionDefinition.SortOrder = DictionaryHelper.GetValue(dictionary, "SortOrder", 0);

			return matrixDimensionDefinition;
		}
コード例 #2
0
        private static WfMatrixDefinition CreateMatrixDefinition()
        {
            WfMatrixDefinition md = new WfMatrixDefinition();

            md.Name = "测试矩阵";
            md.Key  = "TestMatrix";

            WfMatrixDimensionDefinition ddConstCenter = new WfMatrixDimensionDefinition();

            ddConstCenter.DimensionKey = "ConstCenter";
            ddConstCenter.Name         = "成本中心";

            md.Dimensions.Add(ddConstCenter);

            WfMatrixDimensionDefinition ddPaymentMethod = new WfMatrixDimensionDefinition();

            ddPaymentMethod.DimensionKey = "PaymentMethod";
            ddPaymentMethod.Name         = "付款方式";

            md.Dimensions.Add(ddPaymentMethod);

            return(md);
        }
コード例 #3
0
		private static WfMatrixDefinition CreateMatrixDefinition()
		{
			WfMatrixDefinition md = new WfMatrixDefinition();

			md.Name = "测试矩阵";
			md.Key = "TestMatrix";

			WfMatrixDimensionDefinition ddConstCenter = new WfMatrixDimensionDefinition();

			ddConstCenter.DimensionKey = "ConstCenter";
			ddConstCenter.Name = "成本中心";

			md.Dimensions.Add(ddConstCenter);

			WfMatrixDimensionDefinition ddPaymentMethod = new WfMatrixDimensionDefinition();

			ddPaymentMethod.DimensionKey = "PaymentMethod";
			ddPaymentMethod.Name = "付款方式";

			md.Dimensions.Add(ddPaymentMethod);

			return md;
		}
コード例 #4
0
        private static WfMatrixRow AddMatrixRow(WfMatrix matrix, params string[] values)
        {
            WfMatrixRow row = new WfMatrixRow(matrix);

            row.RowNumber = matrix.Rows.Count;

            for (int i = 0; i < matrix.Definition.Dimensions.Count; i++)
            {
                WfMatrixDimensionDefinition dd = matrix.Definition.Dimensions[i];

                WfMatrixCell cell = new WfMatrixCell(dd);

                if (i < values.Length)
                {
                    cell.StringValue = values[i];
                }

                row.Cells.Add(cell);
            }

            matrix.Rows.Add(row);

            return(row);
        }