Example #1
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);
        }
Example #2
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);
        }
Example #3
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);
        }
Example #4
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);
        }
Example #5
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);
        }
Example #6
0
        private void SetInterfaceHisMasterDataSource(int pageSize)
        {
            Expression <Func <TL_BASEDATA, dynamic> > select =
                c =>
                new
            {
                c.UID,
                操作员  = c.OperName,
                日志时间 = c.LogTime,
                操作类型 = c.LogType,
                数据类型 = c.DataType,
                原值   = c.OldValue,
                新值   = c.NewValue,
                备注   = c.Remark,
            };

            Expression <Func <TL_BASEDATA, bool> > where = c => true;
            Expression <Func <TL_BASEDATA, long> > order = c => c.UID;

            int total;

            grid.MasterDataSource = EniitiesHelper.GetPagedDataAsc(_db,
                                                                   select,
                                                                   where,
                                                                   order,
                                                                   grid.PageIndex, grid.PageSize, out total);
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #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);
        }
Example #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);
        }
Example #9
0
        private void SetInterfaceHisMasterDataSource(int pageSize)
        {
            Expression <Func <TL_OPER, dynamic> > select =
                c =>
                new
            {
                c.UID,
                工号   = c.OperCode,
                操作员  = c.OperName,
                日志时间 = c.LogTime,
                日志类型 = c.LogType,
                主机名称 = c.LogSite,
                日志信息 = c.Message
            };

            Expression <Func <TL_OPER, bool> > where = c => true;
            Expression <Func <TL_OPER, long> > order = c => c.UID;

            int total;

            grid.MasterDataSource = EniitiesHelper.GetPagedDataAsc(_db,
                                                                   select,
                                                                   where,
                                                                   order,
                                                                   grid.PageIndex, grid.PageSize, out total);
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #10
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;
        }
Example #11
0
        private void SetMasterDataSource(int pageIndex, int pageSize)
        {
            Expression <Func <TB_BILL, dynamic> > select =
                c =>
                new
            {
                c.UID,
                单据编号  = c.BillNum,
                单据类型  = c.BillType,
                子单据类型 = c.SubBillType,
//                        单据子类型 = c.SubBillType,
//                        采购订单编号 = c.SourceBillNum,
//                        发货单编号 = c.SourceBillNum2,
//                        开始时间 = c.StartTime,
//                        结束时间 = c.FinishTime,
//                        供应商编号 = c.SplyId,
//                        客户编号 = c.CustId,
                单据时间 = c.BillTime,
                操作员  = c.OperName,
                状态   = ((BillState)c.State).ToString(),
                备注   = c.Remark,
            };

            Expression <Func <TB_BILL, bool> > where;
            if (string.IsNullOrEmpty(GlobalVar.Oper.DeptCode))
            {
                where = c => c.BillType == (int)_billType;
            }
            else
            {
                where = c => c.BillType == (int)_billType && c.Factory == GlobalVar.Oper.DeptCode;
            }
            Expression <Func <TB_BILL, long> > order = c => c.UID;

            int total;

            grid.MasterDataSource = EniitiesHelper.GetPagedDataDesc(_db,
                                                                    select,
                                                                    where,
                                                                    order,
                                                                    pageIndex,
                                                                    pageSize,
                                                                    out total);
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageIndex != pageIndex)
            {
                grid.PageIndex = pageIndex;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #12
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;
        }
Example #13
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);
        }
Example #14
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);
        }
Example #15
0
        private void SetMasterDataSource(int pageIndex, int pageSize)
        {
            Expression <Func <TB_BILL, dynamic> > select =
                c =>
                new
            {
                c.UID,
                单据编号  = c.BillNum,
                单据类型  = c.BillType,
                单据子类型 = c.SubBillType,
                源单编号  = c.SourceBillNum,
                供应商编号 = c.SplyId,
                单据时间  = c.BillTime,
                操作员   = c.OperName,
                状态    = ((BillState)c.State).ToString(),
                备注    = c.Remark,
            };
            Expression <Func <TB_BILL, long> > order = c => c.UID;

            int total;

            grid.MasterDataSource = EniitiesHelper.GetPagedDataDesc(_db,
                                                                    select,
                                                                    _where,
                                                                    order,
                                                                    grid.PageIndex,
                                                                    grid.PageSize,
                                                                    out total);
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageIndex != pageIndex)
            {
                grid.PageIndex = pageIndex;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #16
0
        private void SetStockDetailMasterDataSource(int pageSize)
        {
            Expression <Func <TS_STOCK_DETAIL, dynamic> > select = c => c;
            Expression <Func <TS_STOCK_DETAIL, bool> >    @where = c => true;
            Expression <Func <TS_STOCK_DETAIL, long> >    order  = c => c.UID;
            var grid = gridStockDetail;
            int total;

            grid.MasterDataSource = EniitiesHelper.GetPagedDataAsc(_db,
                                                                   select,
                                                                   where,
                                                                   order,
                                                                   grid.PageIndex, grid.PageSize, out total);
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #17
0
        private void SetInterfaceMasterDataSource(int pageSize)
        {
            Expression <Func <TL_INTERFACE, dynamic> > select =
                c =>
                new
            {
                c.UID,
                接口类型 = c.InterfaceType,
                接口文本 = c.InterfaceString,
                状态   = c.State,
                备注   = c.Remark,
                创建时间 = c.CreateTime,
                执行时间 = c.ProcessTime,
                效日期  = c.BillNum,
                单据类型 = c.BillType,
            };

            Expression <Func <TL_INTERFACE, bool> > where = c => true;
            Expression <Func <TL_INTERFACE, long> > order = c => c.UID;

            int total;
            var grid = gridInterface;
            var list = EniitiesHelper.GetPagedDataAsc(_db,
                                                      select,
                                                      where,
                                                      order,
                                                      grid.PageIndex, grid.PageSize, out total);

            grid.MasterDataSource = list.Count > 0 ? list :null;
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #18
0
        private void SetInterfaceHisMasterDataSource(int pageSize)
        {
            Expression <Func <TL_TRANSACTION, dynamic> > select =
                c =>
                new
            {
                c.UID,
                操作员  = c.OperName,
                日志时间 = c.LogTime,
                单据编号 = c.BillNum,
                单据类型 = c.BillType,
                零件号  = c.PartCode,
                批次   = c.Batch,
                数量   = c.Qty,
                库位   = c.LocCode,
                备注   = c.Remark,
            };

            Expression <Func <TL_TRANSACTION, bool> > where = c => true;
            Expression <Func <TL_TRANSACTION, long> > order = c => c.UID;

            int total;

            grid.MasterDataSource = EniitiesHelper.GetPagedDataAsc(_db,
                                                                   select,
                                                                   where,
                                                                   order,
                                                                   grid.PageIndex, grid.PageSize, out total);
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #19
0
        private void SetStockMasterDataSource(int pageSize)
        {
            Expression <Func <VS_STOCK, dynamic> > select = c => c;

            Expression <Func <VS_STOCK, bool> > where;
            where = c => true;
            Expression <Func <VS_STOCK, string> > order = c => c.PartCode;
            var grid = gridStock;
            int total;

            grid.MasterDataSource = EniitiesHelper.GetPagedDataAsc(_db,
                                                                   select,
                                                                   where,
                                                                   order,
                                                                   grid.PageIndex, grid.PageSize, out total);
            if (grid.Total != total)
            {
                grid.Total = total;
            }
            if (grid.PageSize != pageSize)
            {
                grid.PageSize = pageSize;
            }
        }
Example #20
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);
        }