Exemplo n.º 1
0
        private int SetDetailDataSource(string billnum)
        {
            int count;
            Expression <Func <TB_STOCK_MOVE, dynamic> > select = c => c;

            Expression <Func <TB_STOCK_MOVE, bool> > where = c => c.BillNum == billnum;
            Expression <Func <TB_STOCK_MOVE, long> > order = c => c.UID;

            _list = EniitiesHelper.GetData(_db,
                                           select,
                                           where,
                                           order,
                                           out count);
            bs.DataSource = _db.TB_STOCK_MOVE.Where(p => p.BillNum == billnum).ToList();
            //bs.DataSource = _list;
            grid.PrimaryGrid.DataSource = bs;
            bn.BindingSource            = bs;
            List <string> readonlyColumns = new List <string> {
                "UID", "单据号",
            };

            foreach (GridColumn column in grid.PrimaryGrid.Columns)
            {
                if (readonlyColumns.Contains(column.DataPropertyName))
                {
                    column.ReadOnly = true;
                }
                else
                {
                    column.ReadOnly = false;
                }
            }
            return(count);
        }
Exemplo n.º 2
0
        private int SetDetailDataSource(string billNum)
        {
            int count;
            Expression <Func <TB_OUT, dynamic> > select = c =>
                                                          new
            {
                物料号  = c.PartCode,
                批次   = c.Batch,
                来源库位 = c.FromLocCode,
                申请数量 = c.BillQty,
                出库数量 = c.OutQty,
                单价   = c.UnitPrice,
                金额   = c.Amount,
                部门   = c.DeptCode,
                项目   = c.ProjectCode,
                产线   = c.WorklineCode,
                设备   = c.EqptCode,
                申请人  = c.AskUser,
                申请时间 = c.AskTime,
                批准人  = c.ConfirmUser,
                批准时间 = c.ConfirmTime,
                状态   = ((BillState)c.State).ToString(),
                备注   = c.Remark,
            };

            Expression <Func <TB_OUT, bool> > where = c => c.BillNum == billNum;
            Expression <Func <TB_OUT, long> > order = c => c.UID;

            grid.Detail1DataSource = EniitiesHelper.GetData(_db,
                                                            select,
                                                            where,
                                                            order,
                                                            out count);
            return(count);
        }
Exemplo n.º 3
0
        private int SetDetailDataSource(string billNum)
        {
            int count;
            Expression <Func <TB_INVENTORY_DETAIL, dynamic> > select = c =>
                                                                       new
            {
                盘点库位 = c.CheckLocCode,
                物料号  = c.PartCode,
                批次   = c.Batch,
                账面数量 = c.BookQty,
                盘点数量 = c.CheckQty,
                盘点时间 = c.CheckTime,
                盘点人  = c.OperName
            };

            Expression <Func <TB_INVENTORY_DETAIL, bool> > where = c => c.BillNum == billNum;
            Expression <Func <TB_INVENTORY_DETAIL, long> > order = c => c.UID;

            grid.Detail1DataSource = EniitiesHelper.GetData(_db,
                                                            select,
                                                            where,
                                                            order,
                                                            out count);
            return(count);
        }
Exemplo n.º 4
0
        private void FilterDataSource()
        {
            Expression <Func <TA_PART, dynamic> > select = c => c;
            Expression <Func <TA_PART, long> >    order  = c => c.UID;

            where = c => 1 == 1;
            if (tbName.Text != "")
            {
                if (tbModel.Text != "")
                {
                    where = c => c.PartDesc1.Contains(tbName.Text) && c.PartDesc2.Contains(tbModel.Text);
                }
                else
                {
                    where = c => c.PartDesc1.Contains(tbName.Text);
                }
            }
            else
            {
                if (tbModel.Text != "")
                {
                    where = c => c.PartDesc2.Contains(tbModel.Text);
                }
            }
            int count;
            var _list = EniitiesHelper.GetData(_db,
                                               @select,
                                               @where,
                                               order,
                                               out count);

            grid.PrimaryGrid.DataSource = _list;
        }
Exemplo n.º 5
0
        private int SetDetailDataSource(string billNum)
        {
            int count;

            Expression <Func <TB_IN, dynamic> > select =
                c =>
                new
            {
                c.UID,
                单据编号 = c.BillNum,
                订单编号 = c.PoBillNum,
                订单行  = c.PoLineNum,
                零件号  = c.PartCode,
                批次   = c.Batch,
                收货库位 = c.ToLocCode,
                收货数量 = c.Qty,
                单价   = c.UnitPrice,
                生产日期 = c.ProduceDate,
                状态   = ((BillState)c.State).ToString(),
                备注   = c.Remark,
            };

            Expression <Func <TB_IN, bool> > where = c => c.BillNum == billNum;
            Expression <Func <TB_IN, long> > order = c => c.UID;

            grid.Detail1DataSource = EniitiesHelper.GetData(_db,
                                                            select,
                                                            where,
                                                            order,
                                                            out count);
            return(count);
        }
Exemplo n.º 6
0
        private int SetDetailDataSource(string billnum)
        {
            int count;
            Expression <Func <TB_OUT, dynamic> > select = c => c;

            Expression <Func <TB_OUT, bool> > where = c => c.BillNum == billnum;
            Expression <Func <TB_OUT, long> > order = c => c.UID;

            grid.MasterDataSource = EniitiesHelper.GetData(_db,
                                                           select,
                                                           where,
                                                           order,
                                                           out count);
            List <string> readonlyColumns = new List <string> {
                "UID", "单据号",
            };

            foreach (GridColumn column in grid.MasterPrimaryGrid.Columns)
            {
                if (readonlyColumns.Contains(column.DataPropertyName))
                {
                    column.ReadOnly = true;
                }
                else
                {
                    column.ReadOnly = false;
                }
            }
            return(count);
        }
Exemplo n.º 7
0
        private int SetDetailDataSource(string billNum)
        {
            int count;
            Expression <Func <TB_PO, dynamic> > select =
                c =>
                new
            {
                c.UID,
                单据编号 = c.BillNum,
                行次   = c.Line,
                零件号  = c.PartCode,
                订单数量 = c.BillQty,
                收货数量 = c.ArrialQty,
                状态   = ((BillState)c.State).ToString(),
                备注   = c.Remark,
            };

            Expression <Func <TB_PO, bool> > where = c => c.BillNum == billNum;
            Expression <Func <TB_PO, long> > order = c => c.UID;

            grid.Detail1DataSource = EniitiesHelper.GetData(_db,
                                                            select,
                                                            where,
                                                            order,
                                                            out count);
            return(count);
        }
Exemplo n.º 8
0
        private int SetDetailDataSource(string billNum)
        {
            int count;
            Expression <Func <TB_OTHER_IN, dynamic> > select = c =>
                                                               new
            {
                物料号  = c.PartCode,
                批次   = c.Batch,
                生产日期 = c.ProduceDate,
                目标库位 = c.ToLocCode,
                入库数量 = c.Qty,
                单价   = c.UnitPrice,
                金额   = c.Amount,
                备注   = c.Remark,
            };

            Expression <Func <TB_OTHER_IN, bool> > where = c => c.BillNum == billNum;
            Expression <Func <TB_OTHER_IN, long> > order = c => c.UID;

            grid.Detail1DataSource = EniitiesHelper.GetData(_db,
                                                            select,
                                                            where,
                                                            order,
                                                            out count);
            return(count);
        }
Exemplo n.º 9
0
        private void FilterDataSource()
        {
            Expression <Func <VIEW_STOCK_DETAIL, dynamic> > select = c => c;
            Expression <Func <VIEW_STOCK_DETAIL, string> >  order  = c => c.零件号;

            where = c => 1 == 1;
            if (tbName.Text != "")
            {
                if (tbModel.Text != "")
                {
                    if (tbKW.Text != "")
                    {
                        where = c => c.零件描述1.Contains(tbName.Text) && c.零件描述1.Contains(tbModel.Text) && c.库位.Contains(tbKW.Text);
                    }
                    else
                    {
                        where = c => c.零件描述1.Contains(tbName.Text) && c.零件描述1.Contains(tbModel.Text);
                    }
                }
                else
                {
                    if (tbKW.Text != "")
                    {
                        where = c => c.零件描述2.Contains(tbName.Text) && c.库位.Contains(tbKW.Text);
                    }
                    else
                    {
                        where = c => c.零件描述2.Contains(tbName.Text);
                    }
                }
            }
            else
            {
                if (tbModel.Text != "")
                {
                    if (tbKW.Text != "")
                    {
                        where = c => c.零件描述2.Contains(tbModel.Text) && c.库位.Contains(tbKW.Text);
                    }
                    else
                    {
                        where = c => c.零件描述2.Contains(tbModel.Text);
                    }
                }
            }
            int count;
            var _list = EniitiesHelper.GetData(_db,
                                               @select,
                                               @where,
                                               order,
                                               out count);

            grid.PrimaryGrid.DataSource = _list;
        }
Exemplo n.º 10
0
        private int SetDetailDataSource(string billnum)
        {
            int count;
            Expression <Func <TB_ASK, dynamic> > select = c =>
                                                          new
            {
                c.UID,
                c.BillNum,
                c.PartCode,
                c.Qty,
                c.DeptCode,
                c.ProjectCode,
                c.WorklineCode,
                c.EqptCode,
                c.AskUser,
                c.AskTime,
                c.ConfirmUser,
                c.ConfirmTime,
                c.State,
                c.Remark
            };

            Expression <Func <TB_ASK, bool> > where = c => c.BillNum == billnum;
            Expression <Func <TB_ASK, long> > order = c => c.UID;

            _list = EniitiesHelper.GetData(_db,
                                           select,
                                           where,
                                           order,
                                           out count);
            bs.DataSource = _db.TB_ASK.Where(p => p.BillNum == billnum).ToList();
            //bs.DataSource = _list;
            grid.PrimaryGrid.DataSource = bs;
            bn.BindingSource            = bs;
            List <string> readonlyColumns = new List <string> {
                "UID", "单据号",
            };

            foreach (GridColumn column in grid.PrimaryGrid.Columns)
            {
                if (readonlyColumns.Contains(column.DataPropertyName))
                {
                    column.ReadOnly = true;
                }
                else
                {
                    column.ReadOnly = false;
                }
            }
            return(count);
        }
Exemplo n.º 11
0
        private int SetDetailDataSource(string billNum, string locCode)
        {
            int count;
            Expression <Func <TB_INVENTORY_DETAIL, dynamic> > select = c => c;

            Expression <Func <TB_INVENTORY_DETAIL, bool> > where = c => c.BillNum == billNum && c.CheckLocCode == locCode;
            Expression <Func <TB_INVENTORY_DETAIL, long> > order = c => c.UID;

            grid.PrimaryGrid.DataSource = EniitiesHelper.GetData(_db,
                                                                 select,
                                                                 where,
                                                                 order,
                                                                 out count);
            return(count);
        }
Exemplo n.º 12
0
        private int SetDetailDataSource(string billNum)
        {
            int count;
            Expression <Func <TB_STOCK_MOVE, dynamic> > select = c =>
                                                                 new
            {
                物料号  = c.PartCode,
                批次   = c.Batch,
                来源库位 = c.FromLocCode,
                目标库位 = c.ToLocCode,
                移动数量 = c.Qty,
                备注   = c.Remark
            };

            Expression <Func <TB_STOCK_MOVE, bool> > where = c => c.BillNum == billNum;
            Expression <Func <TB_STOCK_MOVE, long> > order = c => c.UID;

            grid.Detail1DataSource = EniitiesHelper.GetData(_db,
                                                            select,
                                                            where,
                                                            order,
                                                            out count);
            return(count);
        }