Exemplo n.º 1
0
        public List <GoodsVO> LoadData(Goods goods, int?supplierId, PageVO page)
        {
            string sql = "SELECT g.GID,"
                         + "g.GName,"
                         + "g.Abbr,"
                         + "g.Specs,"
                         + "g.SubCatgID,"
                         + "g.ShelfLife,"
                         + "g.Remark,"
                         + "g.ST,"
                         + "catg.CName as CatgName "
                         + "FROM GOODS g,SUB_CATEGORY catg ";
            Dictionary <string, object> values = new Dictionary <string, object>();

            if (null != supplierId && supplierId != 0)
            {
                sql += ",SUPPLY_INFO sinfo "
                       + "WHERE g.SubCatgID=catg.CID "
                       + "AND g.GID=sinfo.GID "
                       + "AND sinfo.ST=@sinfo_ST "
                       + "AND sinfo.CustID=@CustID ";
                values.Add("sinfo_ST", ST.VALID);
                values.Add("CustID", supplierId);
            }
            else
            {
                sql += "WHERE g.SubCatgID=catg.CID ";
            }
            if (null != goods.GID__PK && goods.GID__PK != 0)
            {
                sql += "AND g.GID LIKE @GID ";
                values.Add("GID", "%" + goods.GID__PK + "%");
            }
            if (!StringUtil.isEmpty(goods.GName))
            {
                sql += "AND(g.GName LIKE @GName OR g.Abbr LIKE @GName) ";
                values.Add("GName", "%" + goods.GName + "%");
            }
            if (null != goods.SubCatgID && goods.SubCatgID != 0)
            {
                sql += "AND g.SubCatgID=@SID ";
                values.Add("SID", goods.SubCatgID);
            }
            if (!StringUtil.isEmpty(goods.St))
            {
                sql += "AND g.ST=@g_ST ";
                values.Add("g_ST", goods.St);
            }
            sql += "ORDER BY g.GID";

            if (null == page)
            {
                return(Connector.LoadModels <GoodsVO>(sql, values));
            }
            else
            {
                return(Connector.LoadModelsByPage <GoodsVO>(sql, values, page));
            }
        }
Exemplo n.º 2
0
 public List <StockOutOrderDetailVO> LoadOrderDetail(string orderNO, PageVO page)
 {
     if (StringUtil.isEmpty(orderNO))
     {
         return(null);
     }
     return(service.LoadOrderDetail(orderNO, page));
 }
Exemplo n.º 3
0
 public List <RefundOrderDetailVO> LoadOrderDetail(string orderNO, PageVO page)
 {
     if (StringUtil.isEmpty(orderNO))
     {
         return(null);
     }
     return(service.LoadOrderDetail(orderNO, DIRECT.REFUND2SUPPLIER, page));
 }
Exemplo n.º 4
0
 public List <GoodsVO> LoadSupplyGoods(int custId, PageVO page)
 {
     if (0 == custId)
     {
         return(null);
     }
     return(service.LoadSupplyGoods(custId, page));
 }
Exemplo n.º 5
0
 public List <GoodsVO> LoadData(Goods goods, PageVO page, int?supplierId = null)
 {
     if (null == goods)
     {
         goods = new Goods();
     }
     return(service.LoadData(goods, supplierId, page));
 }
Exemplo n.º 6
0
 public List <Customer> LoadData(Customer cust, PageVO page)
 {
     if (null == cust)
     {
         return(null);
     }
     return(service.LoadData(cust, page));
 }
Exemplo n.º 7
0
 public PageVO[] Collection(DataTable table)
 {
     int length = table.Rows.Count;
     PageVO[] result = new PageVO[length];
     for (int i = 0; i < length; i++) {
         result [i] = new PageVO ();
     }
     return result;
 }
Exemplo n.º 8
0
        public List <StockGoodsVO> LoadSoldGoods(Order order, int catgId, PageVO page)
        {
            string sql = "SELECT odr.OrderNO,"
                         + "odr.CustID,"
                         + "odr.CustName,"
                         + "si.ExpDt,"
                         + "g.GID,"
                         + "g.GName,"
                         + "g.Specs,"
                         + "g.Remark,"
                         + "so.Num,"
                         + "so.RfNum,"
                         + "so.Price,"
                         + "so.SID as TgtSID,"
                         + "inv.InvID "
                         + "FROM ORDERS odr,"
                         + "STOCKOUT so,"
                         + "STOCKIN si,"
                         + "INVENTORY inv,"
                         + "GOODS g "
                         + "WHERE odr.OrderNO=so.OrderNO "
                         + "AND inv.InvID = so.InvID "
                         + "AND si.OrderNO = inv.OrderNO "
                         + "AND si.GID = inv.GID "
                         + "AND si.GID = g.GID "
                         + "AND odr.Direct=@direct "
                         + "AND (so.Num-so.rfNum)>0 ";
            Dictionary <string, object> values = new Dictionary <string, object>();

            values.Add("direct", DIRECT.STOCK_OUT);
            if (catgId != 0)
            {
                sql += "AND g.SubCatgID=@catgId ";
                values.Add("catgId", catgId);
            }
            if (null != order.CustID && order.CustID != 0)
            {
                sql += "AND odr.CustID=@custId ";
                values.Add("custId", order.CustID);
            }
            if (!StringUtil.isEmpty(order.OrderNO__PK))
            {
                sql += "AND odr.OrderNO LIKE @OrderNO ";
                values.Add("OrderNO", "%" + order.OrderNO__PK + "%");
            }
            sql += "ORDER BY si.ExpDt,g.GID";

            if (null == page)
            {
                return(Connector.LoadModels <StockGoodsVO>(sql, values));
            }
            else
            {
                return(Connector.LoadModelsByPage <StockGoodsVO>(sql, values, page));
            }
        }
        private void OnPageSourceChange(PageVO newSource)
        {
            Invalidate("PageLoadingDelayTime");
            Invalidate("CurrentPageSource");

            //Rollback the manipulation to the entity data
            DbManager.Instance.RollBack();

            //Every time navigate to new source, the view model of those source page will be instantiated again
            //_mainScreenWindow.Navigate(newSource);
        }
Exemplo n.º 10
0
        public MStocktakingForm()
        {
            InitializeComponent();
            dtgvGoods.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            page        = new PageVO();
            page.PageNo = 1;

            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }
            if (null == subCatgManager)
            {
                subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr);
            }
            if (null == manager)
            {
                manager = InterfaceProxyGenerator.CreateInterfaceProxy <IInventoryManager>(usr);
            }

            Customer cust = new Customer();

            cust.Grade = GRADE.SUPPLIER;
            cust.St    = ST.VALID;
            List <Customer> custs = custManager.LoadData(cust, null);

            List <Customer> custList = new List <Customer>();
            Customer        tmpCust  = new Customer();

            tmpCust.CID__PK = 0;
            tmpCust.CName   = "---选择---";
            custList.Add(tmpCust);
            custList.AddRange(custs);

            cboxSuppliers.DisplayMember = "CName";
            cboxSuppliers.ValueMember   = "CID__PK";
            cboxSuppliers.DataSource    = custList;

            List <SubCatgVO> scatgs   = subCatgManager.LoadData(false, null);
            List <SubCatgVO> catgList = new List <SubCatgVO>();
            SubCatgVO        catgVO   = new SubCatgVO();

            catgVO.CName   = "全部";
            catgVO.CId__PK = 0;
            catgList.Add(catgVO);
            catgList.AddRange(scatgs);

            cboxCatgs.DisplayMember = "CName";
            cboxCatgs.ValueMember   = "CId__PK";
            cboxCatgs.DataSource    = catgList;
        }
Exemplo n.º 11
0
        public List <Customer> LoadData(Customer cust, PageVO page)
        {
            string sql = "SELECT * FROM CUSTOMERS cs WHERE 1=1 ";
            Dictionary <string, object> values = null;

            if (!StringUtil.isEmpty(cust.CName))
            {
                if (null == values)
                {
                    values = new Dictionary <string, object>();
                }
                sql += "AND cs.CName LIKE @CName ";
                values.Add("CName", "%" + cust.CName + "%");
            }
            if (!StringUtil.isEmpty(cust.LinkMan))
            {
                if (null == values)
                {
                    values = new Dictionary <string, object>();
                }
                sql += "AND cs.LinkMan LIKE @LinkMan ";
                values.Add("LinkMan", "%" + cust.LinkMan + "%");
            }
            if (!StringUtil.isEmpty(cust.St))
            {
                if (null == values)
                {
                    values = new Dictionary <string, object>();
                }
                sql += "AND cs.ST=@ST ";
                values.Add("ST", cust.St);
            }
            if (!StringUtil.isEmpty(cust.Grade))
            {
                if (null == values)
                {
                    values = new Dictionary <string, object>();
                }
                sql += "AND cs.Grade=@GRADE ";
                values.Add("GRADE", cust.Grade);
            }
            sql += "ORDER BY cs.CID";

            if (null == page)
            {
                return(Connector.LoadModels <Customer>(sql, values));
            }
            else
            {
                return(Connector.LoadModelsByPage <Customer>(sql, values, page));
            }
        }
Exemplo n.º 12
0
        public List <StockGoodsVO> LoadSoldGoodsByKeyWords(string term, int?resellerId)
        {
            string sql = "SELECT odr.OrderNO,"
                         + "odr.CustID,"
                         + "odr.CustName,"
                         + "si.ExpDt,"
                         + "g.GID,"
                         + "g.GName,"
                         + "g.Specs,"
                         + "g.Remark,"
                         + "so.Num,"
                         + "so.RfNum,"
                         + "so.Price,"
                         + "so.SID as TgtSID,"
                         + "inv.InvID "
                         + "FROM ORDERS odr,"
                         + "STOCKOUT so,"
                         + "STOCKIN si,"
                         + "INVENTORY inv,"
                         + "GOODS g "
                         + "WHERE odr.OrderNO=so.OrderNO "
                         + "AND inv.InvID = so.InvID "
                         + "AND si.OrderNO = inv.OrderNO "
                         + "AND si.GID = inv.GID "
                         + "AND si.GID = g.GID "
                         + "AND odr.Direct=@direct "
                         + "AND (so.Num-so.rfNum)>0 ";
            Dictionary <string, object> values = new Dictionary <string, object>();

            values.Add("direct", DIRECT.STOCK_OUT);
            if (null != resellerId && resellerId != 0)
            {
                sql += "AND odr.CustID=@custId ";
                values.Add("custId", resellerId);
            }
            if (!StringUtil.isEmpty(term))
            {
                sql += "AND (g.GName LIKE @term OR g.Abbr LIKE @term OR g.GID LIKE @term) ";
                values.Add("term", "%" + term + "%");
            }
            sql += "ORDER BY g.GName";

            PageVO page = new PageVO();

            page.PageNo   = 1;
            page.PageSize = 30;
            return(Connector.LoadModelsByPage <StockGoodsVO>(sql, values, page));
        }
Exemplo n.º 13
0
        public MRefund2SupplierForm()
        {
            InitializeComponent();
            dtgvRfGoods.AutoGenerateColumns  = false;
            dtgvRfOrders.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            page        = new PageVO();
            page.PageNo = 1;
            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }
            if (null == subCatgManager)
            {
                subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr);
            }
            if (null == refundManager)
            {
                refundManager = InterfaceProxyGenerator.CreateInterfaceProxy <IRefund2SupplierManager>(usr);
            }
            if (null == goodsManager)
            {
                goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr);
            }

            Customer cust = new Customer();

            cust.Grade = GRADE.SUPPLIER;
            cust.St    = ST.VALID;
            List <Customer> custs = custManager.LoadData(cust, null);

            cboxNSupplier.DisplayMember = "CName";
            cboxNSupplier.ValueMember   = "CID__PK";
            cboxNSupplier.DataSource    = custs;

            List <Customer> custList = new List <Customer>();
            Customer        tmpCust  = new Customer();

            tmpCust.CID__PK = 0;
            tmpCust.CName   = "--全部--";
            custList.Add(tmpCust);
            custList.AddRange(custs);
            cboxQySupplier.DisplayMember = "CName";
            cboxQySupplier.ValueMember   = "CID__PK";
            cboxQySupplier.DataSource    = custList;
        }
Exemplo n.º 14
0
        public MStockOutForm()
        {
            InitializeComponent();
            dtgvSOutGoods.AutoGenerateColumns  = false;
            dtgvMOutOrders.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            page        = new PageVO();
            page.PageNo = 1;
            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }
            if (null == goodsManager)
            {
                goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr);
            }
            if (null == stockOutManager)
            {
                stockOutManager = InterfaceProxyGenerator.CreateInterfaceProxy <IStockOutManager>(usr);
            }

            Customer cust = new Customer();

            cust.Grade = GRADE.RESELLER;
            cust.St    = ST.VALID;
            List <Customer> resellers = custManager.LoadData(cust, null);

            cboxNResellers.DisplayMember = "CName";
            cboxNResellers.ValueMember   = "CID__PK";
            cboxNResellers.DataSource    = resellers;

            List <Customer> qyResellers = new List <Customer>();
            Customer        reseller    = new Customer();

            reseller.CID__PK = 0;
            reseller.CName   = "--全部--";
            qyResellers.Add(reseller);
            qyResellers.AddRange(resellers);

            cboxQyReseller.DisplayMember = "CName";
            cboxQyReseller.ValueMember   = "CID__PK";
            cboxQyReseller.DataSource    = qyResellers;
        }
Exemplo n.º 15
0
        public BilliingVO LoadBill(string billNO, int custId, PageVO page)
        {
            string sql = "SELECT b.BillNO,"
                         + "b.Direct,"
                         + "b.Amount,"
                         + "b.FactAmount,"
                         + "b.CustID,"
                         + "b.CustName,"
                         + "b.CrtTmst,"
                         + "b.CrtUsrId,"
                         + "u.UName as CrtUsrName "
                         + "FROM BILLING b,USR u "
                         + "WHERE b.CrtUsrId=u.UID "
                         + "AND b.CustID=@custId "
                         + "AND b.BillNO=@billNO";
            Dictionary <string, object> values = new Dictionary <string, object>();

            values.Add("custId", custId);
            values.Add("billNO", billNO);
            List <BilliingVO> list = Connector.LoadModels <BilliingVO>(sql, values);

            if (null == list || list.Count < 1)
            {
                return(null);
            }

            sql    = "SELECT * FROM BILLING_INFO WHERE BillNO=@billNO";
            values = new Dictionary <string, object>();
            values.Add("billNO", billNO);
            List <BillingInfo> binfos = Connector.LoadModels <BillingInfo>(sql, values);

            if (null != binfos && binfos.Count > 0)
            {
                List <string> orderNOs = new List <string>();
                foreach (BillingInfo binfo in binfos)
                {
                    orderNOs.Add(binfo.OrderNO);
                }
                list[0]._OrderNOList = orderNOs;
            }
            return(list[0]);
        }
Exemplo n.º 16
0
        public SupplyGoodsForm(Customer supplier)
        {
            InitializeComponent();
            Usr usr = MainForm.usr;

            page          = new PageVO();
            page.PageNo   = 1;
            page.PageSize = 100;
            goodsMap      = new Dictionary <int, Goods>();
            if (null == goodsManager)
            {
                goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr);
            }
            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }
            if (null == catgManager)
            {
                catgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr);
            }

            List <SubCatgVO> subCatgs = catgManager.LoadData(false, null);
            List <SubCatgVO> list     = new List <SubCatgVO>();
            SubCatgVO        subCatg  = new SubCatgVO();

            subCatg.CName   = "全部";
            subCatg.CId__PK = 0;
            list.Add(subCatg);
            list.AddRange(subCatgs);
            cboxCatg.DisplayMember = "CName";
            cboxCatg.ValueMember   = "CID__PK";
            cboxCatg.DataSource    = list;

            List <Customer> custs = new List <Customer>();

            custs.Add(supplier);
            cboxSupplier.DisplayMember = "CName";
            cboxSupplier.ValueMember   = "CID__PK";
            cboxSupplier.DataSource    = custs;
        }
Exemplo n.º 17
0
        public SoldGoodsForm(Customer customer)
        {
            InitializeComponent();
            dtgvSoldGoods.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            goodsMap      = new Dictionary <long, StockGoodsVO>();
            page          = new PageVO();
            page.PageSize = 100;
            page.PageNo   = 1;

            if (null == subCatgManager)
            {
                subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr);
            }
            if (null == manager)
            {
                manager = InterfaceProxyGenerator.CreateInterfaceProxy <IInventoryManager>(usr);
            }
            this.customer = customer;
            this.Text     = "【回收单】 " + customer.CName;

            List <SubCatgVO> scatgs   = subCatgManager.LoadData(false, null);
            List <SubCatgVO> catgList = new List <SubCatgVO>();
            SubCatgVO        catgVO   = new SubCatgVO();

            catgVO.CName   = "全部";
            catgVO.CId__PK = 0;
            catgList.Add(catgVO);
            catgList.AddRange(scatgs);
            cboxCatgs.DisplayMember = "CName";
            cboxCatgs.ValueMember   = "CId__PK";
            cboxCatgs.DataSource    = catgList;

            List <Customer> custs = new List <Customer>();

            custs.Add(customer);
            cboxResellers.DataSource    = custs;
            cboxResellers.DisplayMember = "CName";
            cboxResellers.ValueMember   = "CID__PK";
        }
Exemplo n.º 18
0
        public MGoodsForm()
        {
            InitializeComponent();
            page        = new PageVO();
            page.PageNo = 1;
            dtgvMGoods.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            if (null == manager)
            {
                manager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr);
            }
            if (null == subCatgManager)
            {
                subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr);
            }

            BindingSource stBs = new BindingSource();
            Dictionary <string, string> goodsMap = new Dictionary <string, string>();

            goodsMap.Add("", "全部");
            goodsMap.Add(ST.VALID, ST.GOODS_MAP[ST.VALID]);
            goodsMap.Add(ST.INVALID, ST.GOODS_MAP[ST.INVALID]);
            stBs.DataSource      = goodsMap;
            cboxSt.DisplayMember = "Value";
            cboxSt.ValueMember   = "Key";
            cboxSt.DataSource    = stBs;

            List <SubCatgVO> subCatgs = subCatgManager.LoadData(false, null);
            List <SubCatgVO> list     = new List <SubCatgVO>();
            SubCatgVO        subCatg  = new SubCatgVO();

            subCatg.CName   = "全部";
            subCatg.CId__PK = 0;
            list.Add(subCatg);
            list.AddRange(subCatgs);
            cboxCatg.DisplayMember = "CName";
            cboxCatg.ValueMember   = "CID__PK";
            cboxCatg.DataSource    = list;
        }
Exemplo n.º 19
0
        public AddGoods2CustForm(int custId, string custName)
        {
            InitializeComponent();
            dtgvGoods.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            supplyGoods   = new Dictionary <int, SupplyInfo>();
            page          = new PageVO();
            page.PageSize = 100;
            page.PageNo   = 1;
            if (null == goodsManager)
            {
                goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr);
            }
            if (null == subCatgManager)
            {
                subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr);
            }
            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }
            this.custId = custId;

            List <SubCatgVO> subCatgs = subCatgManager.LoadData(false, null);
            List <SubCatgVO> list     = new List <SubCatgVO>();
            SubCatgVO        subCatg  = new SubCatgVO();

            subCatg.CName   = "全部";
            subCatg.CId__PK = 0;
            list.Add(subCatg);
            list.AddRange(subCatgs);
            cboxCatg.DisplayMember = "CName";
            cboxCatg.ValueMember   = "CID__PK";
            cboxCatg.DataSource    = list;

            this.Text = custName;
        }
Exemplo n.º 20
0
        public MSupplyInfoForm()
        {
            InitializeComponent();
            Usr usr = MainForm.usr;

            page        = new PageVO();
            page.PageNo = 1;
            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }
            dtgvSpGoods.AutoGenerateColumns = false;

            Customer cust = new Customer();

            cust.St    = ST.VALID;
            cust.Grade = GRADE.SUPPLIER;
            List <Customer> list = custManager.LoadData(cust, null);

            cboxSupplier.DataSource    = list;
            cboxSupplier.DisplayMember = "CName";
            cboxSupplier.ValueMember   = "CID__PK";
        }
Exemplo n.º 21
0
        public DataTable GetDataByPage(string sql, Dictionary <string, object> values, PageVO page)
        {
            string totalSql = "SELECT COUNT(1) ";

            sql = sql.ToUpper();
            int findex = sql.IndexOf("FROM");
            int oindex = Regex.Replace(sql, @"ORDER\s+BY", "ORDER BY").LastIndexOf("ORDER BY");

            if (oindex > 0)
            {
                totalSql += sql.Substring(findex, oindex - findex);
            }
            else
            {
                totalSql += sql.Substring(findex);
            }
            MySqlCommand command = InitCmd(totalSql, values);
            object       obj     = command.ExecuteScalar();
            int          total   = int.Parse(obj.ToString());

            page.TotalNum = total;

            sql += " LIMIT @startNo,@pageSize";
            if (null == values)
            {
                values = new Dictionary <string, object>();
            }
            if (page.PageNo < 1)
            {
                page.PageNo = 1;
            }
            values.Add("startNo", (page.PageNo - 1) * page.PageSize);
            values.Add("pageSize", page.PageSize);
            command = InitCmd(sql, values);
            MySqlDataAdapter adapter = new MySqlDataAdapter(command);
            DataTable        dt      = new DataTable();

            adapter.Fill(dt);
            return(dt);
        }
Exemplo n.º 22
0
 public List <OrderGoodsVO> LoadOrderGoods(int supplierId, List <string> orderNOList, PageVO page)
 {
     if (null == orderNOList || orderNOList.Count == 0)
     {
         return(null);
     }
     return(orderService.LoadSupplierOrderGoods(supplierId, orderNOList, page));
 }
Exemplo n.º 23
0
 PageVO Init(DataRow dr)
 {
     if (dr == null)
         return null;
     PageVO VO = new PageVO ();
     VO.pageId = dr["page_id"] as string;
     VO.title = dr["title"] as string;
     VO.describe = dr["describe"] as string;
     VO.ispost = dr["ispost"] as string;
     VO.group = dr["group"] as string;
     VO.index = Convert.ToInt32(dr["index"]);
     VO.jtype = dr["jtype"] as string;
     VO.content = dr["content"] as string;
     return VO;
 }
Exemplo n.º 24
0
 public List <SubCatgVO> LoadData(bool withInvalid, PageVO page)
 {
     return(service.LoadData(withInvalid, page));
 }
Exemplo n.º 25
0
        public GoodsInStockForm(Customer customer, string direct)
        {
            InitializeComponent();
            dtgvGoodsInStock.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            goodsMap      = new Dictionary <long, StockGoodsVO>();
            page          = new PageVO();
            page.PageSize = 100;
            page.PageNo   = 1;

            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }
            if (null == subCatgManager)
            {
                subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr);
            }
            if (null == manager)
            {
                manager = InterfaceProxyGenerator.CreateInterfaceProxy <IInventoryManager>(usr);
            }
            this.customer = customer;
            string title = string.Empty;

            if (DIRECT.REFUND2SUPPLIER == direct)
            {
                title = "退货单";
            }
            else if (DIRECT.STOCK_OUT == direct)
            {
                title = "出货单";
            }
            else
            {
                return;
            }
            this.Text = "【" + title + "】" + " " + customer.CName;

            List <Customer> custList = new List <Customer>();

            if (DIRECT.REFUND2SUPPLIER == direct)
            {
                custList.Add(customer);
            }
            else if (DIRECT.STOCK_OUT == direct)
            {
                Customer cust = new Customer();
                cust.Grade = GRADE.SUPPLIER;
                cust.St    = ST.VALID;
                List <Customer> custs = custManager.LoadData(cust, null);

                Customer tmpCust = new Customer();
                tmpCust.CID__PK = 0;
                tmpCust.CName   = "---选择---";
                custList.Add(tmpCust);
                custList.AddRange(custs);
            }

            cboxSuppliers.DisplayMember = "CName";
            cboxSuppliers.ValueMember   = "CID__PK";
            cboxSuppliers.DataSource    = custList;

            List <SubCatgVO> scatgs   = subCatgManager.LoadData(false, null);
            List <SubCatgVO> catgList = new List <SubCatgVO>();
            SubCatgVO        catgVO   = new SubCatgVO();

            catgVO.CName   = "全部";
            catgVO.CId__PK = 0;
            catgList.Add(catgVO);
            catgList.AddRange(scatgs);

            cboxCatgs.DisplayMember = "CName";
            cboxCatgs.ValueMember   = "CId__PK";
            cboxCatgs.DataSource    = catgList;
        }
Exemplo n.º 26
0
 private PSW_PageController()
 {
     CurrentPageOV = new PageVO(NonePage.Value.PageUri,
                                NonePage.Value.LoadingDelayTime);
 }
Exemplo n.º 27
0
 public List <OrderVO> LoadOrders(Order order, DateTime?startDt, DateTime?endDt, PageVO page)
 {
     if (null == order)
     {
         return(null);
     }
     if (null == orderService)
     {
         orderService = base.CreateService(typeof(OrderService), ConnectorId) as OrderService;
     }
     return(orderService.LoadOrders(order, startDt, endDt, page));
 }
Exemplo n.º 28
0
        /// <summary>
        /// 加载入库单信息
        /// </summary>
        /// <param name="order"></param>
        /// <returns>入库单列表</returns>
        public List <OrderVO> LoadOrders(Order order, DateTime?startDt, DateTime?endDt, PageVO page)
        {
            string sql = "SELECT od.OrderNO,"
                         + "od.Amount,"
                         + "od.CustID,"
                         + "od.CustName,"
                         + "od.Direct,"
                         + "od.UptTmst,"
                         + "od.CrtTmst,"
                         + "od.UptUID,"
                         + "od.CrtUID,"
                         + "od.Handled,"
                         + "binfo.BillNO,"
                         + "u1.UName as crtUName,"
                         + "u2.UName as uptUName "
                         + "FROM ORDERS od "
                         + "LEFT JOIN BILLING_INFO binfo ON(od.OrderNO=binfo.OrderNO) "
                         + "JOIN USR u1 ON(od.CrtUID=u1.UID) "
                         + "JOIN USR u2  ON(od.UptUID=u2.UID) ";
            Dictionary <string, object> values = new Dictionary <string, object>();

            if (null != startDt && null == endDt)
            {
                endDt = ((DateTime)startDt).AddMonths(1);
            }
            else if (null == startDt && null != endDt)
            {
                startDt = ((DateTime)endDt).AddMonths(-1);
            }
            else if (null == startDt && null == endDt)
            {
                endDt   = DateTime.Parse(DateTime.Now.ToShortDateString());
                startDt = ((DateTime)endDt).AddMonths(-3);
            }
            endDt = ((DateTime)endDt).AddDays(1);
            sql  += "WHERE od.CrtTmst>=@StDt AND od.CrtTmst<@EndDt ";
            values.Add("StDt", startDt);
            values.Add("EndDt", endDt);
            if (!StringUtil.isEmpty(order.Handled))
            {
                sql += "AND od.Handled=@handled ";
                values.Add("handled", order.Handled);
            }
            if (!StringUtil.isEmpty(order.Direct))
            {
                sql += "AND od.Direct=@Direct ";
                values.Add("Direct", order.Direct);
            }
            if (!StringUtil.isEmpty(order.OrderNO__PK))
            {
                sql += "AND od.OrderNO LIKE @OrderNO ";
                values.Add("OrderNO", "%" + order.OrderNO__PK + "%");
            }
            if (null != order.CustID && order.CustID != 0)
            {
                sql += "AND od.CustID=@CustID ";
                values.Add("CustID", order.CustID);
            }
            sql += "ORDER BY od.Handled,od.OrderNO DESC";

            if (null == page)
            {
                return(Connector.LoadModels <OrderVO>(sql, values));
            }
            else
            {
                return(Connector.LoadModelsByPage <OrderVO>(sql, values, page));
            }
        }
Exemplo n.º 29
0
        public List <OrderGoodsVO> LoadSupplierOrderGoods(int custId, List <string> orderNOList, PageVO page)
        {
            string sinSql = "SELECT g.GID,"
                            + "g.GName,"
                            + "g.Specs,"
                            + "s.Num,"
                            + "s.Price,"
                            + "s.OrderNO,"
                            + "od.Direct,"
                            + "od.CrtTmst as Tmst "
                            + "FROM STOCKIN s, GOODS g, ORDERS od "
                            + "WHERE s.GID = g.GID "
                            + "AND s.OrderNO = od.OrderNO "
                            + "AND od.CustID = @custId "
                            + "AND od.Direct = @sinDirect "
                            + "AND od.OrderNO IN(@sinOrderNOs)";

            string rfSql = "SELECT g.GID,"
                           + "g.GName,"
                           + "g.Specs,"
                           + "r.Num,"
                           + "r.Price,"
                           + "r.OrderNO,"
                           + "od.Direct,"
                           + "od.CrtTmst as Tmst "
                           + "FROM REFUNDS r, INVENTORY inv, GOODS g, ORDERS od "
                           + "WHERE r.InvID = inv.InvID "
                           + "AND inv.GID = g.GID "
                           + "AND r.OrderNO = od.OrderNO "
                           + "AND od.CustID = @custId "
                           + "AND od.Direct = @rfDirect "
                           + "AND od.OrderNO IN(@rfOrderNOs)";

            string sinOrderNOs = "", rfOrderNOs = "";
            Dictionary <string, object> values = new Dictionary <string, object>();

            foreach (string orderNO in orderNOList)
            {
                if (orderNO.StartsWith(ORDERNO_PREF.STOCK_IN))
                {
                    sinOrderNOs += "," + orderNO + "";
                }
                else if (orderNO.StartsWith(ORDERNO_PREF.SIN_REFUND))
                {
                    rfOrderNOs += "," + orderNO + "";
                }
                else
                {
                    return(null);
                }
            }
            string sql = string.Empty;

            if (sinOrderNOs.Length > 0)
            {
                sinOrderNOs = sinOrderNOs.Substring(1);
                sql         = sinSql;
                values.Add("custId", custId);
                values.Add("sinOrderNOs", sinOrderNOs);
                values.Add("sinDirect", DIRECT.STOCK_IN);
            }
            if (rfOrderNOs.Length > 0)
            {
                rfOrderNOs = rfOrderNOs.Substring(1);
                if (sql.Length > 0)
                {
                    sql += "UNION ALL ";
                }
                else
                {
                    values.Add("custId", custId);
                }
                sql += rfSql;
                values.Add("rfOrderNOs", rfOrderNOs);
                values.Add("rfDirect", DIRECT.REFUND2SUPPLIER);
            }

            if (sql.Length > 0)
            {
                if (null == page)
                {
                    return(Connector.LoadModels <OrderGoodsVO>(sql, values));
                }
                else
                {
                    return(Connector.LoadModelsByPage <OrderGoodsVO>(sql, values, page));
                }
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 30
0
        public MSupplierBillingForm()
        {
            InitializeComponent();
            dtgvOrders.AutoGenerateColumns  = false;
            dtgvBilling.AutoGenerateColumns = false;
            Usr usr = MainForm.usr;

            selectedOrdrMap  = new Dictionary <string, decimal>();
            orderPage        = new PageVO();
            billPage         = new PageVO();
            orderPage.PageNo = 1;
            billPage.PageNo  = 1;
            if (null == billingManager)
            {
                billingManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISupplierBillingManager>(usr);
            }
            if (null == custManager)
            {
                custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr);
            }

            Customer cust = new Customer();

            cust.Grade = GRADE.SUPPLIER;
            cust.St    = ST.VALID;
            List <Customer> custs = custManager.LoadData(cust, null);

            cboxQrdSupplier.DisplayMember = "CName";
            cboxQrdSupplier.ValueMember   = "CID__PK";
            cboxQrdSupplier.DataSource    = custs;

            cboxBillSuppliers.DisplayMember = "CName";
            cboxBillSuppliers.ValueMember   = "CID__PK";
            cboxBillSuppliers.DataSource    = custs;

            BindingSource directBs = new BindingSource();

            directBs.DataSource = new Dictionary <string, string> {
                { string.Empty, "全部" }, { DIRECT.STOCK_IN, "进货单" }, { DIRECT.REFUND2SUPPLIER, "退货单" }
            };
            cboxDirect.DataSource    = directBs;
            cboxDirect.DisplayMember = "Value";
            cboxDirect.ValueMember   = "Key";

            BindingSource stBs = new BindingSource();
            Dictionary <string, string> stDict = new Dictionary <string, string> {
                { string.Empty, "全部" }
            };

            foreach (string key in HANDLE_FLAG.HANDLE_MAP.Keys)
            {
                stDict.Add(key, HANDLE_FLAG.HANDLE_MAP[key]);
            }
            stBs.DataSource         = stDict;
            cboxEntry.DataSource    = stBs;
            cboxEntry.DisplayMember = "Value";
            cboxEntry.ValueMember   = "Key";

            BindingSource settleBs = new BindingSource();

            settleBs.DataSource = new Dictionary <string, string> {
                { string.Empty, "全部" }, { "false", "未结清" }, { "true", "已结清" }
            };
            cboxBillSt.DataSource    = settleBs;
            cboxBillSt.DisplayMember = "Value";
            cboxBillSt.ValueMember   = "Key";
        }
Exemplo n.º 31
0
 public List <BilliingVO> LoadBills(Billing bill, bool?settled, DateTime?startDt, DateTime?endDt, PageVO page)
 {
     if (null == bill)
     {
         bill = new Billing();
     }
     bill.Direct = PYMNT_DIRECT.PAY;
     return(service.LoadBills(bill, settled, startDt, endDt, page));
 }
Exemplo n.º 32
0
 public List <BillingChldVO> LoadBillingChld(string billNO, PageVO page)
 {
     return(service.LoadBillingChld(billNO, page));
 }