コード例 #1
0
        protected override DQueryDom GetQueryDom()
        {
            var alias = new JoinAlias(typeof(tempClass));
            var query = new DQueryDom(alias);

            query.RegisterQueryTable(typeof(tempClass), new string[] { "Department_ID", "AccountingUnit_ID", "PlanNumber_ID", "AccountingUnit_Name", "PlanNumber_Name", "Name", "Code", "OutputNumber", "InStoreNumber" }, tempClass.GetQueryDom(mQueryContainer, sd, ed));
            foreach (ListItem field in checkbox.Items)
            {
                if (field.Selected)
                {
                    if (field.Value == "OutputNumber" || field.Value == "InStoreNumber")
                    {
                        query.Columns.Add(DQSelectColumn.Sum(field.Value));
                        SumColumnIndexs.Add(query.Columns.Count - 1);
                    }
                    else if (field.Value == "DiffNumber")
                    {
                        query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Subtract(DQExpression.IfNull(DQExpression.Field("OutputNumber"), DQExpression.Value(0)), DQExpression.IfNull(DQExpression.Field("InStoreNumber"), DQExpression.Value(0)))), field.Text));
                        SumColumnIndexs.Add(query.Columns.Count - 1);
                    }
                    else
                    {
                        query.Columns.Add(DQSelectColumn.Field(field.Value));
                        query.GroupBy.Expressions.Add(DQExpression.Field(field.Value));
                    }
                }
            }
            var accids = mQueryContainer.GetControl <DFChoiceBox>("AccountingUnit_ID").Value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

            var pnumberids = mQueryContainer.GetControl <DFChoiceBox>("PlanNumber_ID").Value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

            if (accids.Length > 0)
            {
                query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("AccountingUnit_ID"), accids.Select(x => DQExpression.Value(long.Parse(x))).ToArray()));
            }

            if (pnumberids.Length > 0)
            {
                query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("PlanNumber_ID"), pnumberids.Select(x => DQExpression.Value(long.Parse(x))).ToArray()));
            }

            OrganizationUtil.AddOrganizationLimit <Department>(query, "Department_ID");

            if (query.Columns.Count == 0)
            {
                throw new Exception("至少选择一条显示列");
            }
            return(query);
        }
コード例 #2
0
 public static void Register(DQueryDom mainDom, DateTime?date)
 {
     mainDom.RegisterQueryTable(typeof(FrozenOutTemp), new[] { "Date", "Goods_ID", "成品ID", "成品Name", "Number", "SecondNumber2" }, GetDom(date));
 }
コード例 #3
0
 public static void Register(DQueryDom mainDom, DateTime?date)
 {
     mainDom.RegisterQueryTable(typeof(FrozeTemp), new[] { "Goods_ID", "AllNumber", "AllSecondNumber2" }, GetAllNumDom(date));
 }
コード例 #4
0
 public static void Register(DQueryDom mainDom, DateTime?date)
 {
     mainDom.RegisterQueryTable(typeof(ProductOutTemp), new[] { "AccountingUnit_ID", "ProductionUnit_ID", "AccountingUnit_Name", "Department_Name", "Time", "Goods_ID", "Goods_Name", "GoodsCategory_ID", "Number", "SecondNumber2" }, GetDom(date));
 }