Beispiel #1
0
        /// <summary>
        /// 获取商品销售价格信息
        /// </summary>
        /// <returns></returns>
        public IEnumerable <GoodsSaleInfoVM> GetGoodsSaleInfo()
        {
            GoodsBaseInfo bInfo = new GoodsBaseInfo();
            GoodsStock    stock = new GoodsStock();
            OQL           joinQ = OQL.From(bInfo)
                                  .Join(stock).On(bInfo.SerialNumber, stock.SerialNumber)
                                  .Select(bInfo.GoodsName, bInfo.Manufacturer, bInfo.SerialNumber, stock.GoodsPrice, stock.MakeOnDate, bInfo.CanUserMonth, stock.Stocks, stock.GoodsID)
                                  .OrderBy(bInfo.GoodsName, "asc")
                                  .END;

            PWMIS.DataProvider.Data.AdoHelper db = PWMIS.DataProvider.Adapter.MyDB.GetDBHelper();
            EntityContainer ec = new EntityContainer(joinQ, db);

            ec.Execute();
            var result = ec.Map <GoodsSaleInfoVM>(e =>
            {
                e.GoodsName    = ec.GetItemValue <string>(0);
                e.Manufacturer = ec.GetItemValue <string>(1);
                e.SerialNumber = ec.GetItemValue <string>(2);
                e.GoodsPrice   = ec.GetItemValue <decimal>(3);
                e.MakeOnDate   = ec.GetItemValue <DateTime>(4);
                e.CanUserMonth = ec.GetItemValue <int>(5);
                e.Stocks       = ec.GetItemValue <int>(6);
                e.GoodsID      = ec.GetItemValue <int>(7);
                return(e);
            }
                                                  );

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// 获取商品销售单视图
        /// </summary>
        /// <returns></returns>
        public IEnumerable <GoodsSellNoteVM> GetGoodsSellNote()
        {
            GoodsSellNote       note = new GoodsSellNote();
            Employee            emp  = new Employee();
            CustomerContactInfo cst  = new CustomerContactInfo();
            OQL joinQ = OQL.From(note)
                        .InnerJoin(emp).On(note.SalesmanID, emp.WorkNumber)
                        .InnerJoin(cst).On(note.CustomerID, cst.CustomerID)
                        .Select(note.NoteID, cst.CustomerName, note.ManchinesNumber, emp.EmployeeName, note.SalesType, note.SellDate)
                        .OrderBy(note.NoteID, "desc")
                        .END;

            PWMIS.DataProvider.Data.AdoHelper db = PWMIS.DataProvider.Adapter.MyDB.GetDBHelper();
            EntityContainer ec = new EntityContainer(joinQ, db);

            ec.Execute();
            //可以使用下面的方式获得各个成员元素列表
            //var noteList = ec.Map<GoodsSellNote>().ToList();
            //var empList = ec.Map<Employee>().ToList();
            //var cstList = ec.Map<CustomerContactInfo>().ToList();
            //直接使用下面的方式获得新的视图对象
            var result = ec.Map <GoodsSellNoteVM>(e =>
            {
                e.NoteID          = ec.GetItemValue <int>(0);
                e.CustomerName    = ec.GetItemValue <string>(1);
                e.ManchinesNumber = ec.GetItemValue <string>(2);
                e.EmployeeName    = ec.GetItemValue <string>(3);
                e.SalesType       = ec.GetItemValue <string>(4);
                e.SellDate        = ec.GetItemValue <DateTime>(5);
                return(e);
            }
                                                  );

            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// 获取商品销售价格信息
        /// </summary>
        /// <returns></returns>
        public IEnumerable<GoodsSaleInfoVM> GetGoodsSaleInfo()
        {
            GoodsBaseInfo bInfo = new GoodsBaseInfo();
            GoodsStock stock = new GoodsStock();
            OQL joinQ = OQL.From(bInfo)
                .Join(stock).On(bInfo.SerialNumber, stock.SerialNumber)
                .Select(bInfo.GoodsName, bInfo.Manufacturer, bInfo.SerialNumber, stock.GoodsPrice, stock.MakeOnDate, bInfo.CanUserMonth, stock.Stocks, stock.GoodsID)
                .OrderBy(bInfo.GoodsName, "asc")
                .END;

            PWMIS.DataProvider.Data.AdoHelper db = PWMIS.DataProvider.Adapter.MyDB.GetDBHelper();
            EntityContainer ec = new EntityContainer(joinQ, db);
            ec.Execute();
            var result = ec.Map<GoodsSaleInfoVM>(e =>
                {
                    e.GoodsName = ec.GetItemValue<string>(0); 
                    e.Manufacturer = ec.GetItemValue<string>(1);
                    e.SerialNumber  = ec.GetItemValue<string>(2);
                    e.GoodsPrice  = ec.GetItemValue<decimal>(3);
                    e.MakeOnDate = ec.GetItemValue<DateTime>(4);
                    e.CanUserMonth = ec.GetItemValue<int>(5);
                    e.Stocks = ec.GetItemValue<int>(6);
                    e.GoodsID = ec.GetItemValue<int>(7);
                    return e;
                }
            );
            return result;
        }
Beispiel #4
0
        /// <summary>
        /// 获取商品销售单视图
        /// </summary>
        /// <returns></returns>
        public IEnumerable<GoodsSellNoteVM> GetGoodsSellNote()
        {
            GoodsSellNote note = new GoodsSellNote();
            Employee emp = new Employee();
            CustomerContactInfo cst=new CustomerContactInfo ();
            OQL joinQ = OQL.From(note)
                .InnerJoin(emp).On(note.SalesmanID, emp.WorkNumber)
                .InnerJoin(cst).On(note.CustomerID, cst.CustomerID)
                .Select(note.NoteID, cst.CustomerName, note.ManchinesNumber, emp.EmployeeName, note.SalesType, note.SellDate)
                .OrderBy(note.NoteID, "desc")
                .END;

            PWMIS.DataProvider.Data.AdoHelper db = PWMIS.DataProvider.Adapter.MyDB.GetDBHelper();
            EntityContainer ec = new EntityContainer(joinQ, db);  
            ec.Execute();
            //可以使用下面的方式获得各个成员元素列表
            //var noteList = ec.Map<GoodsSellNote>().ToList();
            //var empList = ec.Map<Employee>().ToList();
            //var cstList = ec.Map<CustomerContactInfo>().ToList();
            //直接使用下面的方式获得新的视图对象
            var result = ec.Map<GoodsSellNoteVM>(e =>
                {
                    e.NoteID = ec.GetItemValue<int>(0);
                    e.CustomerName = ec.GetItemValue<string>(1);
                    e.ManchinesNumber = ec.GetItemValue<string>(2);
                    e.EmployeeName = ec.GetItemValue<string>(3);
                    e.SalesType = ec.GetItemValue<string>(4);
                    e.SellDate = ec.GetItemValue<DateTime>(5);
                    return e;
                }
            );
            return result;
        }