当前位置: 首页>>代码示例>>C#>>正文


C# ADODB.Recordset.Fields方法代码示例

本文整理汇总了C#中ADODB.Recordset.Fields方法的典型用法代码示例。如果您正苦于以下问题:C# ADODB.Recordset.Fields方法的具体用法?C# ADODB.Recordset.Fields怎么用?C# ADODB.Recordset.Fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ADODB.Recordset的用法示例。


在下文中一共展示了ADODB.Recordset.Fields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: loadFilter

        public bool loadFilter(ref string filter_Renamed)
        {
            bool functionReturnValue = false;
            ADODB.Recordset rs = new ADODB.Recordset();
            ADODB.Recordset RSitem = new ADODB.Recordset();
            short lCNT = 0;
            rs = modRecordSet.getRS(ref "SELECT * From ftOrderSet Where (((ftSet_Group) = 'order')) ORDER BY ftSet_Order;");
            if (rs.BOF | rs.EOF) {
                functionReturnValue = false;
            } else {
                lCNT = -1;
                objectArray = new object[rs.RecordCount];
                while (!(rs.EOF)) {
                    lCNT = lCNT + 1;
                    switch (rs.Fields("ftset_type").Value) {
                        case 2:

                            if (lCNT) {
                                //_frmList_0.
                                //frmList.Load(lCNT)
                                //cmdList.Load(lCNT)
                                cmdList[lCNT].Parent = _frmList_0;
                                //lblList.Load(lCNT)
                                _lblList_0.Parent = _frmList_0;
                            }

                            _frmList_0.Visible = true;
                            _cmdList_0.Visible = true;
                            _lblList_0.Visible = true;
                            if (lCNT)
                                _frmList_0.Top = sizeConvertors.twipsToPixels(lCNT * sizeConvertors.pixelToTwips(_frmList_0.Height, false) + sizeConvertors.pixelToTwips(_frmList_0.Top, false), false);
                            _frmList_0.Text = rs.Fields("ftset_DisplayName").Value;
                            _frmList_0.Tag = rs.Fields("ftset_Name").Value;
                            _lblList_0.Text = "";
                            RSitem = modRecordSet.getRS(ref "SELECT ftData_Heading From ftOrder WHERE (ftData_PersonID = " + modRecordSet.gPersonID + ") AND (ftData_FieldName = '" + Strings.Replace(_frmList_0.Tag, "'", "''") + "')");
                            if (RSitem.BOF | RSitem.EOF) {
                            } else {
                                _lblList_0.Text = RSitem.Fields("ftData_Heading").Value;
                            }

                            objectArray[lCNT] = _frmList_0;

                            break;
                    }
                    rs.MoveNext();
                }
                this.Height = sizeConvertors.twipsToPixels(objectArray[Information.UBound(objectArray)].Top + objectArray[Information.UBound(objectArray)].Height + 1000, false);

                loadLanguage();
                ShowDialog();
                functionReturnValue = true;
            }
            return functionReturnValue;
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:54,代码来源:frmFilterOrder.cs

示例2: loadItem

        public void loadItem()
        {
            ADODB.Recordset rj = default(ADODB.Recordset);
            System.Windows.Forms.CheckBox oCheck = null;

            adoPrimaryRS = modRecordSet.getRS(ref "SELECT Company_HOParamBit FROM Company");

            const short gReOrderLvl = 1;
            const short gEmployeePer = 2;
            const short gWaitronCount = 4;
            const short gActualCost = 8;
            const short gPromotion = 16;
            const short gRecipe = 32;

             // ERROR: Not supported in C#: OnErrorStatement

            //Bind the check boxes to the data provider
            this._chkBit_1.CheckState = System.Math.Abs(Convert.ToInt32(Convert.ToBoolean(adoPrimaryRS.Fields("Company_HOParamBit").Value & gReOrderLvl)));
            this._chkBit_2.CheckState = System.Math.Abs(Convert.ToInt32(Convert.ToBoolean(adoPrimaryRS.Fields("Company_HOParamBit").Value & gEmployeePer)));
            this._chkBit_3.CheckState = System.Math.Abs(Convert.ToInt32(Convert.ToBoolean(adoPrimaryRS.Fields("Company_HOParamBit").Value & gWaitronCount)));
            this._chkBit_4.CheckState = System.Math.Abs(Convert.ToInt32(Convert.ToBoolean(adoPrimaryRS.Fields("Company_HOParamBit").Value & gActualCost)));
            this._chkBit_5.CheckState = System.Math.Abs(Convert.ToInt32(Convert.ToBoolean(adoPrimaryRS.Fields("Company_HOParamBit").Value & gPromotion)));
            this._chkBit_6.CheckState = System.Math.Abs(Convert.ToInt32(Convert.ToBoolean(adoPrimaryRS.Fields("Company_HOParamBit").Value & gRecipe)));

            ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:26,代码来源:frmMainHOParam.cs

示例3: getMWNo

        public int getMWNo()
        {
            int functionReturnValue = 0;
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            rsMWare = modRecordSet.getRS(ref "SELECT WarehouseID, Warehouse_Name From Warehouse WHERE (WarehouseID > 1) ORDER BY WarehouseID");
            if (rsMWare.RecordCount == 1) {
                functionReturnValue = rsMWare.Fields("WarehouseID").Value;
                goto jumpOut;
            }

            cmbMWNo.Items.Clear();
            while (!(rsMWare.EOF)) {
                cmbMWNo.Items.Add(new LBI(rsMWare.Fields("Warehouse_Name").Value, rsMWare.Fields("WarehouseID").Value));
                rsMWare.moveNext();
            }
            cmbMWNo.SelectedIndex = 0;
            txtWNO.Text = Convert.ToString(cmbMWNo.SelectedIndex);

            loadLanguage();
            this.ShowDialog();
            functionReturnValue = lMWNo;
            jumpOut:
            return functionReturnValue;
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:24,代码来源:frmMWSelect.cs

示例4: getCustomer

        public customer getCustomer(ref int id)
        {
            string sql = null;
            ADODB.Connection cn = default(ADODB.Connection);
            ADODB.Recordset rs = default(ADODB.Recordset);
            customer customer_Renamed = null;
            if (id) {

                cn = modRecordSet.openConnectionInstance();
                if (cn == null) {
                    Interaction.MsgBox("You are not connected to the 4POS BackOffice server! This task can only be performed if you are connected to the server. Please contact your System Administrator.", MsgBoxStyle.Exclamation, "BackOffice Connection Error");
                } else {
                    rs = new ADODB.Recordset();
                    sql = "SELECT Customer.*, [Customer_Current]+[Customer_30Days]+[Customer_60Days]+[Customer_90Days]+[Customer_120Days]+[Customer_150Days] AS balance From Customer WHERE CustomerID=" + id;
                    rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
                    if (rs.RecordCount) {
                        customer_Renamed = new customer();
                        customer_Renamed.Key = rs.Fields("CustomerID").Value;
                        customer_Renamed.channelID = rs.Fields("Customer_ChannelID").Value;
                        customer_Renamed.creditLimit = rs.Fields("Customer_CreditLimit").Value;
                        customer_Renamed.department = rs.Fields("Customer_DepartmentName").Value + "";
                        customer_Renamed.fax = rs.Fields("Customer_Fax").Value + "";
                        customer_Renamed.name = rs.Fields("Customer_InvoiceName").Value + "";
                        customer_Renamed.outstanding = rs.Fields("balance").Value;
                        customer_Renamed.person = rs.Fields("Customer_FirstName").Value + " " + rs.Fields("Customer_Surname").Value;
                        customer_Renamed.physical = rs.Fields("Customer_PhysicalAddress").Value + "";
                        customer_Renamed.postal = rs.Fields("Customer_PostalAddress").Value + "";
                        customer_Renamed.signed_Renamed = customer_Renamed.person;
                        customer_Renamed.telephone = rs.Fields("Customer_Telephone").Value + "";
                        customer_Renamed.terms = rs.Fields("Customer_Terms").Value;
                        customer_Renamed.tax = rs.Fields("Customer_VATNumber").Value + "";
                    }
                }
            }
            return customer_Renamed;
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:36,代码来源:customers.cs

示例5: loadItem

        public void loadItem(ref int id)
        {
            System.Windows.Forms.Label oLabel = null;
            string sql = null;
            ADODB.Recordset rs = default(ADODB.Recordset);
            int lQty = 0;
            rs = modRecordSet.getRS(ref "SELECT StockitemHistory.StockitemHistory_StockItemID From StockitemHistory WHERE (((StockitemHistory.StockitemHistory_StockItemID)=" + id + "));");
            if (rs.RecordCount == 0) {
                sql = "INSERT INTO StockitemHistory (StockitemHistory_StockItemID,  StockitemHistory_Value, StockitemHistory_Day1, StockitemHistory_Day2, StockitemHistory_Day3, StockitemHistory_Day4, StockitemHistory_Day5, StockitemHistory_Day6, StockitemHistory_Day7, StockitemHistory_Day8, StockitemHistory_Day9, StockitemHistory_Day10, StockitemHistory_Day11, StockitemHistory_Day12, StockitemHistory_Week1, StockitemHistory_Week2, StockitemHistory_Week3, StockitemHistory_Week4, StockitemHistory_Week5, StockitemHistory_Week6, StockitemHistory_Week7, StockitemHistory_Week8, StockitemHistory_Week9, StockitemHistory_Week10, StockitemHistory_Week11, StockitemHistory_Week12, StockitemHistory_Month1, StockitemHistory_Month2, StockitemHistory_Month3, StockitemHistory_Month4, StockitemHistory_Month5, StockitemHistory_Month6, StockitemHistory_Month7, StockitemHistory_Month8, StockitemHistory_Month9, StockitemHistory_Month10, StockitemHistory_Month11, StockitemHistory_Month12 )";
                sql = sql + " SELECT " + id + ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;";
                modRecordSet.cnnDB.Execute(sql);
            }
            //    Set rs = getRS("SELECT SaleItem.SaleItem_StockItemID, Sum(IIf([SaleItem_Reversal],0-[SaleItem_ShrinkQuantity]*[SaleItem_Quantity],[SaleItem_ShrinkQuantity]*[SaleItem_Quantity])) AS qty FROM Consignment AS Consignment_1 RIGHT JOIN (Consignment RIGHT JOIN ((SaleItem INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID) INNER JOIN Company ON Sale.Sale_DayEndID = Company.Company_MonthEndID) ON Consignment.Consignment_SaleID = Sale.SaleID) ON Consignment_1.Consignment_ReversalSaleID = Sale.SaleID Where (((SaleItem.SaleItem_Revoke) = 0) And ((SaleItem.SaleItem_DepositType) = 0) And ((Consignment.ConsignmentID) Is Null) And ((Consignment_1.ConsignmentID) Is Null)) GROUP BY SaleItem.SaleItem_StockItemID HAVING (((SaleItem.SaleItem_StockItemID)=" & id & "));")
            sql = "SELECT Sum(sales.qty) AS SumOfqty FROM (SELECT SaleItem.SaleItem_StockItemID, (IIf([SaleItem_Reversal],0-[SaleItem_ShrinkQuantity]*[SaleItem_Quantity],[SaleItem_ShrinkQuantity]*[SaleItem_Quantity])) AS qty FROM Consignment AS Consignment_1 RIGHT JOIN (Consignment RIGHT JOIN ((SaleItem INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID) INNER JOIN Company ON Sale.Sale_DayEndID = Company.Company_DayEndID) ON Consignment.Consignment_SaleID = Sale.SaleID) ON Consignment_1.Consignment_ReversalSaleID = Sale.SaleID Where (((SaleItem.SaleItem_StockItemID) = " + id + ") And ((SaleItem.SaleItem_Revoke) = 0) And ((SaleItem.SaleItem_DepositType) = 0) And ((Consignment.ConsignmentID) Is Null) And ((Consignment_1.ConsignmentID) Is Null)) Union SELECT SaleItemReciept.SaleItemReciept_StockitemID AS SaleItem_StockItemID, IIf([SaleItem_Reversal],0-[SaleItemReciept_Quantity]*[SaleItem_Quantity],[SaleItemReciept_Quantity]*[SaleItem_Quantity]) AS qty ";
            sql = sql + "FROM (Consignment AS Consignment_1 RIGHT JOIN (Consignment RIGHT JOIN ((SaleItem INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID) INNER JOIN Company ON Sale.Sale_DayEndID = Company.Company_DayEndID) ON Consignment.Consignment_SaleID = Sale.SaleID) ON Consignment_1.Consignment_ReversalSaleID = Sale.SaleID) INNER JOIN SaleItemReciept ON SaleItem.SaleItemID = SaleItemReciept.SaleItemReciept_SaleItemID WHERE (((SaleItemReciept.SaleItemReciept_StockitemID)=" + id + ") AND ((SaleItem.SaleItem_Revoke)=0) AND ((SaleItem.SaleItem_DepositType)=0) AND ((Consignment.ConsignmentID) Is Null) AND ((Consignment_1.ConsignmentID) Is Null) AND ((SaleItem.SaleItem_Recipe)<>0))) AS sales;";
            //wrong calculation cuz DayEndID = MonthEndID
            //sql = "SELECT Sum(sales.qty) AS SumOfqty FROM (SELECT SaleItem.SaleItem_StockItemID, (IIf([SaleItem_Reversal],0-[SaleItem_ShrinkQuantity]*[SaleItem_Quantity],[SaleItem_ShrinkQuantity]*[SaleItem_Quantity])) AS qty FROM Consignment AS Consignment_1 RIGHT JOIN (Consignment RIGHT JOIN ((SaleItem INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID) INNER JOIN Company ON Sale.Sale_DayEndID = Company.Company_MonthEndID) ON Consignment.Consignment_SaleID = Sale.SaleID) ON Consignment_1.Consignment_ReversalSaleID = Sale.SaleID Where (((SaleItem.SaleItem_StockItemID) = " & id & ") And ((SaleItem.SaleItem_Revoke) = 0) And ((SaleItem.SaleItem_DepositType) = 0) And ((Consignment.ConsignmentID) Is Null) And ((Consignment_1.ConsignmentID) Is Null)) Union SELECT SaleItemReciept.SaleItemReciept_StockitemID AS SaleItem_StockItemID, IIf([SaleItem_Reversal],0-[SaleItemReciept_Quantity]*[SaleItem_Quantity],[SaleItemReciept_Quantity]*[SaleItem_Quantity]) AS qty "
            //sql = sql & "FROM (Consignment AS Consignment_1 RIGHT JOIN (Consignment RIGHT JOIN ((SaleItem INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID) INNER JOIN Company ON Sale.Sale_DayEndID = Company.Company_MonthEndID) ON Consignment.Consignment_SaleID = Sale.SaleID) ON Consignment_1.Consignment_ReversalSaleID = Sale.SaleID) INNER JOIN SaleItemReciept ON SaleItem.SaleItemID = SaleItemReciept.SaleItemReciept_SaleItemID WHERE (((SaleItemReciept.SaleItemReciept_StockitemID)=" & id & ") AND ((SaleItem.SaleItem_Revoke)=0) AND ((SaleItem.SaleItem_DepositType)=0) AND ((Consignment.ConsignmentID) Is Null) AND ((Consignment_1.ConsignmentID) Is Null) AND ((SaleItem.SaleItem_Recipe)<>0))) AS sales;"

            rs = modRecordSet.getRS(ref sql);
            if (rs.RecordCount) {
                lQty = Convert.ToInt32(0 + rs.Fields("SumOfqty").Value);
            } else {
                lQty = 0;
            }

            sql = "SELECT StockItem.StockItemID, StockItem.StockItem_Name, StockItem.StockItem_Quantity, WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity, CCur([WarehouseStockItemLnk_Quantity]/[StockItem_Quantity]) AS cases, StockitemHistory.*, [StockitemHistory_Week1]+" + lQty + " AS thisWeek, [StockitemHistory_Month1]+" + lQty + " AS thisMonth, " + lQty + " AS thisDay FROM (WarehouseStockItemLnk INNER JOIN StockItem ON WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = StockItem.StockItemID) INNER JOIN StockitemHistory ON StockItem.StockItemID = StockitemHistory.StockitemHistory_StockItemID WHERE WarehouseStockItemLnk.WarehouseStockItemLnk_WarehouseID=2 AND StockItem.StockItemID=" + id + ";";
            //sql = "SELECT StockItem.StockItemID, StockItem.StockItem_Name, StockItem.StockItem_Quantity, WarehouseStockItemLnk.WarehouseStockItemLnk_Quantity, CCur([WarehouseStockItemLnk_Quantity]/[StockItem_Quantity]) AS cases, StockitemHistory.*, [StockitemHistory_Week1]+" & lQty & " AS thisWeek, [StockitemHistory_Month1]+" & lQty & " AS thisMonth, " & lQty & " AS thisDay FROM (WarehouseStockItemLnk INNER JOIN StockItem ON WarehouseStockItemLnk.WarehouseStockItemLnk_StockItemID = StockItem.StockItemID) INNER JOIN StockitemHistory ON StockItem.StockItemID = StockitemHistory.StockitemHistory_StockItemID WHERE StockItem.StockItemID=" & id & ";"

            adoPrimaryRS = modRecordSet.getRS(ref sql);
            if (adoPrimaryRS.RecordCount == 0) {
                return;
            }
            foreach (Label oLabel_loopVariable in this.lblField) {
                oLabel = oLabel_loopVariable;
                oLabel.DataBindings.Add(adoPrimaryRS);
            }

            this._lblFieldCurr_0.Text = Strings.FormatNumber(adoPrimaryRS.Fields("cases").Value, 2);

            loadLanguage();
            ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:43,代码来源:frmStockItemHistory.cs

示例6: loadItem

        public void loadItem(ref int id)
        {
            System.Windows.Forms.TextBox oText = null;
            adoPrimaryRS = modRecordSet.getRS(ref "SELECT MonthEnd.MonthEndID, IIf([MonthEndID]=[Company_MonthEndID],'Current',[Company_MonthEndID]-[MonthEndID] & ' month/s ago') AS theMonth, MonthEnd.MonthEnd_Days, MonthEnd.MonthEnd_BudgetSales, MonthEnd.MonthEnd_BudgetPurchases From MonthEnd, Company Where MonthEnd.MonthEndID = " + id);
            setup();
            this.lblMonth.Text = adoPrimaryRS.Fields("theMonth").Value;
            //    For Each oText In Me.txtFields
            //        Set oText.DataBindings.Add(adoPrimaryRS)
            //        oText.MaxLength = adoPrimaryRS(oText.DataField).DefinedSize
            //    Next
            foreach (TextBox oText_loopVariable in txtInteger) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
                oText.Leave += txtInteger_Leave;
                //txtInteger_Leave(txtInteger.Item((oText.Index)), New System.EventArgs())
            }
            foreach (TextBox oText_loopVariable in txtFloat) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
                if (string.IsNullOrEmpty(oText.Text))
                    oText.Text = "0";
                oText.Text = Convert.ToString(Convert.ToDouble(oText.Text) * 100);
                oText.Leave += txtFloat_Leave;
                //txtFloat_Leave(txtFloat.Item((oText.Index)), New System.EventArgs())
            }
            //    For Each oText In Me.txtFloatNegative
            //        Set oText.DataBindings.Add(adoPrimaryRS)
            //        If oText.Text = "" Then oText.Text = "0"
            //        oText.Text = oText.Text * 100
            //        txtFloatNegative_LostFocus oText.Index
            //    Next
            //Bind the check boxes to the data provider
            //        For Each oCheck In Me.chkFields
            //            Set oCheck.DataBindings.Add(adoPrimaryRS)
            //        Next
            buildDataControls();
            mbDataChanged = false;

            loadLanguage();
            ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:41,代码来源:frmMonthendBudget.cs

示例7: loadItem

        public void loadItem(ref int id)
        {
            int blCust = 0;
            int ctSelling = 0;
            bool visable = false;
            ADODB.Recordset rsProp = default(ADODB.Recordset);
            loading = true;
            ADODB.Recordset rsChannel = default(ADODB.Recordset);
            ADODB.Recordset rsQuantity = default(ADODB.Recordset);
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;

            short x = 0;
            decimal lQuantity = default(decimal);
            decimal lDepositQuantity = default(decimal);
            decimal lCost = default(decimal);
            decimal lActualCost = default(decimal);
            decimal lDepositUnit = default(decimal);
            decimal lDepositPack = default(decimal);

            sql = "INSERT INTO Catalogue ( Catalogue_StockItemID, Catalogue_Quantity, Catalogue_Barcode, Catalogue_Deposit, Catalogue_Content, Catalogue_Disabled ) ";
            sql = sql + "SELECT theJoin.StockItemID, theJoin.ShrinkItem_Quantity, 'CODE' AS Expr1, 0 AS deposit, 0 AS content, 0 AS disabled FROM [SELECT StockItem.StockItemID, ShrinkItem.ShrinkItem_Quantity FROM ShrinkItem INNER JOIN ";
            sql = sql + "StockItem ON ShrinkItem.ShrinkItem_ShrinkID = StockItem.StockItem_ShrinkID]. AS theJoin LEFT JOIN Catalogue ON (theJoin.ShrinkItem_Quantity = Catalogue.Catalogue_Quantity) AND (theJoin.StockItemID = Catalogue.Catalogue_StockItemID) ";
            sql = sql + "WHERE (((theJoin.StockItemID)=" + id + ") AND ((Catalogue.Catalogue_StockItemID) Is Null));";
            modRecordSet.cnnDB.Execute(sql);

            sql = "SELECT StockItem.StockItemID, StockItem.StockItem_PackSizeID, StockItem.StockItem_Name, StockItem.StockItem_Quantity, StockItem.StockItem_ListCost, StockItem.StockItem_ActualCost, StockItem.StockItem_PriceSetID, Deposit.Deposit_UnitCost, Deposit.Deposit_CaseCost, Vat.Vat_Amount, Supplier.Supplier_Name, PricingGroup.PricingGroupID, PricingGroup.PricingGroup_Name, PricingGroup.PricingGroup_RemoveCents, PricingGroup.PricingGroup_RoundAfter, PricingGroup.PricingGroup_RoundDown, PricingGroup.PricingGroup_Unit1, PricingGroup.PricingGroup_Case1, PricingGroup.PricingGroup_Unit2, PricingGroup.PricingGroup_Case2, PricingGroup.PricingGroup_Unit3, PricingGroup.PricingGroup_Case3, PricingGroup.PricingGroup_Unit4, PricingGroup.PricingGroup_Case4, PricingGroup.PricingGroup_Unit5, PricingGroup.PricingGroup_Case5, PricingGroup.PricingGroup_Unit6, PricingGroup.PricingGroup_Case6, PricingGroup.PricingGroup_Unit7, PricingGroup.PricingGroup_Case7, PricingGroup.PricingGroup_Unit8, PricingGroup.PricingGroup_Case8 ";
            sql = sql + "FROM (((StockItem INNER JOIN Vat ON StockItem.StockItem_VatID = Vat.VatID) INNER JOIN Deposit ON StockItem.StockItem_DepositID = Deposit.DepositID) INNER JOIN PricingGroup ON StockItem.StockItem_PricingGroupID = PricingGroup.PricingGroupID) INNER JOIN Supplier ON StockItem.StockItem_SupplierID = Supplier.SupplierID WHERE (((StockItem.StockItemID)=" + id + "));";
            rsStockItem = modRecordSet.getRS(ref sql);

            rsChannel = modRecordSet.getRS(ref "SELECT ChannelID, Channel_Name From Channel WHERE (Channel_Disabled = 0) AND (ChannelID <> 9) ORDER BY ChannelID");

            rsQuantity = modRecordSet.getRS(ref "SELECT Catalogue.Catalogue_StockItemID, Catalogue.Catalogue_Quantity, Catalogue.Catalogue_Barcode, Catalogue.Catalogue_Deposit, Catalogue.Catalogue_Content, Catalogue.Catalogue_Disabled, ShrinkItem.ShrinkItem_Code FROM Catalogue INNER JOIN (StockItem INNER JOIN ShrinkItem ON StockItem.StockItem_ShrinkID = ShrinkItem.ShrinkItem_ShrinkID) ON (ShrinkItem.ShrinkItem_Quantity = Catalogue.Catalogue_Quantity) AND (Catalogue.Catalogue_StockItemID = StockItem.StockItemID) Where (((Catalogue.Catalogue_StockItemID) = " + id + ")) ORDER BY Catalogue.Catalogue_Quantity;");

            rsProp = modRecordSet.getRS(ref "SELECT PropChannelLnk.PropChannelLnk_Quantity, PropChannelLnk.PropChannelLnk_ChannelID, PropChannelLnk.PropChannelLnk_Markup From PropChannelLnk WHERE (((PropChannelLnk.PropChannelLnk_StockItemID)=" + id + "));");
            //UPGRADE_WARNING: Use of Null/IsNull() detected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="2EED02CB-5C0E-4DC1-AE94-4FAA3A30F51A"'
            if (Information.IsDBNull(rsStockItem.Fields("StockItem_PriceSetID").Value)) {
            } else {
                rs = modRecordSet.getRS(ref "SELECT PriceSet.PriceSetID, [PriceSet_Name] & '(' & [StockItem_Name] & ')' AS priceSet_FullName, PriceSet.PriceSet_StockItemID FROM StockItem INNER JOIN PriceSet ON StockItem.StockItem_PriceSetID = PriceSet.PriceSetID WHERE (((StockItem.StockItemID)=" + id + ") AND ((PriceSet.PriceSet_Disabled)=0));");
                if (rs.RecordCount) {
                    if (rs.Fields("PriceSet_StockItemID").Value == id) {
                        lblPriceSet.Text = "Primary Pricing Set Item";
                        lblPriceSet.Visible = true;
                        lblPriceSet.BackColor = System.Drawing.Color.Red;
                        lblPriceSet.ForeColor = System.Drawing.Color.White;
                    } else {
                        _txtProp_0.Enabled = false;
                        _txtPrice_0.Enabled = false;
                        lblPriceSet.Text = "Child Pricing Set Item";
                        lblPriceSet.Visible = true;
                        lblPriceSet.BackColor = System.Drawing.Color.Yellow;
                        lblPriceSet.ForeColor = System.Drawing.Color.Black;
                    }
                }
            }
            saveData();
            if (rsStockItem.BOF | rsStockItem.EOF) {
            } else {
                gStockItemID = id;
                gChannelID = 0;
                _txtCost_0.Enabled = false;
                //        _txtVariableCost_0.Enabled = False
                _txtCost_0.BackColor = System.Drawing.ColorTranslator.FromOle(-2147483633);
                _txtVariableCost_0.BackColor = System.Drawing.ColorTranslator.FromOle(-2147483633);
                for (x = 0; x <= frmItem.Count - 1; x++) {
                    //txtCost.Unload(x)
                    //lblMatrix.Unload(x)
                    //txtProp.Unload(x)
                    //lblDepositUnit.Unload(x)
                    //lblDepositPack.Unload(x)
                    //lblVat.Unload(x)
                    //lblMarkup.Unload(x)
                    //lblGP.Unload(x)
                    //txtPrice.Unload(x)
                    //lblPrice.Unload(x)
                    //lblPercent.Unload(x)
                    //lnProfit.Unload(x))
                    //txtVariableCost.Unload(x)
                    //lblProfitAmount.Unload(x)
                    //lblProfitPrecent.Unload(x)
                    //lblSection.Unload(x)
                    //frmItem.Unload(x)
                    //lblGPActual.Unload(x)
                }
                lblVatName.Text = "VAT at " + Strings.FormatNumber(rsStockItem.Fields("Vat_Amount").Value, 2) + "%";
                gVAT = 1 + rsStockItem.Fields("Vat_Amount").Value / 100;
                gRoundAfter = 0;
                gRemoveUnits = 0;
                gRoundDownUnits = 0;
                gRoundAfter = rsStockItem.Fields("PricingGroup_RoundAfter").Value;
                gRemoveUnits = rsStockItem.Fields("PricingGroup_RemoveCents").Value;
                gRoundDownUnits = rsStockItem.Fields("PricingGroup_RoundDown").Value;
                lblPricingGroup.Text = rsStockItem.Fields("PricingGroup_Name").Value;
                lblPricingGroup.Tag = rsStockItem.Fields("PricingGroupID").Value;
                lblPricingGroupRule.Text = " When a Stock Item value is over " + Strings.FormatNumber(gRoundAfter, 2) + " round all amounts below " + gRoundDownUnits + " cents to the lower Rand value, else the amount is rounded to the next highest Rand, then remove " + gRemoveUnits + " cents from the rounded stock item Rand value.";
                lblPricingGroupRule.Tag = lblPricingGroupRule.Text;
                lblStockItemName.Text = rsStockItem.Fields("StockItem_Name").Value;
                lCost = rsStockItem.Fields("StockItem_ListCost").Value;
                lActualCost = rsStockItem.Fields("StockItem_ActualCost").Value;
                lQuantity = rsStockItem.Fields("StockItem_Quantity").Value;
//.........这里部分代码省略.........
开发者ID:nodoid,项目名称:PointOfSale,代码行数:101,代码来源:frmStockPricing.cs

示例8: doSearch

        private void doSearch()
        {
            string sql = null;
            string lString = null;
            System.Windows.Forms.ListViewItem lLI = null;
            gRS = modRecordSet.getRS(ref "SELECT StockItem.StockItem_Name, CashTransaction.CashTransaction_StockItemID, CashTransaction.CashTransaction_Shrink, StockItem.StockItem_PriceSetID, CashTransaction.CashTransaction_Type, CashTransaction_Amount FROM CashTransaction INNER JOIN StockItem ON CashTransaction.CashTransaction_StockItemID = StockItem.StockItemID ORDER BY StockItem.StockItem_Name;");

            //Display the list of Titles in the DataCombo
            lvItem.Items.Clear();
            while (!(gRS.EOF)) {
                lLI = lvItem.Items.Add(gRS.Fields("CashTransaction_StockItemID").Value + "_" + gRS.Fields("CashTransaction_Shrink").Value, gRS.Fields("StockItem_Name").Value, "");
                //UPGRADE_WARNING: Lower bound of collection lLI has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
                if (lLI.SubItems.Count > 1) {
                    lLI.SubItems[1].Text = gRS.Fields("CashTransaction_Shrink").Value;
                } else {
                    lLI.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, gRS.Fields("CashTransaction_Shrink").Value));
                }
                //UPGRADE_WARNING: Lower bound of collection lLI has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
                if (lLI.SubItems.Count > 2) {
                    lLI.SubItems[2].Text = Strings.FormatNumber(gRS.Fields("CashTransaction_Amount").Value, 2);
                } else {
                    lLI.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(gRS.Fields("CashTransaction_Amount").Value, 2)));
                }
                gRS.moveNext();
            }
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:26,代码来源:frmCashTransactionList.cs

示例9: loadItem

        public void loadItem(ref int id)
        {
            System.Windows.Forms.TextBox oText = null;
            System.Windows.Forms.CheckBox oCheck = null;
             // ERROR: Not supported in C#: OnErrorStatement

            if (id) {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from Channel WHERE ChannelID = " + id);
                //        If IsNull(adoPrimaryRS("Channel_PriceToChannel1")) Then
                //            cmbChannelPrice.ListIndex = 0
                //        Else
                switch (adoPrimaryRS.Fields("Channel_PriceToChannel1").Value) {
                    case -1:
                        cmbChannelPrice.SelectedIndex = 1;
                        break;
                    case 1:
                        cmbChannelPrice.SelectedIndex = 2;
                        break;
                    default:
                        cmbChannelPrice.SelectedIndex = 0;
                        break;
                }
                //        End If
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from POS");
                adoPrimaryRS.AddNew();
                this.Text = this.Text + " [New record]";
                mbAddNewFlag = true;
            }

            setup();
            foreach (TextBox oText_loopVariable in txtFields) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
                oText.MaxLength = adoPrimaryRS.Fields(oText.DataBindings).DefinedSize;
            }
            this.optType[Convert.ToInt16(_txtFields_0.Text)].Checked = true;
            if (id == 1) {
                _optType_0.Enabled = false;
                _optType_1.Enabled = false;
            }
            //    For Each oText In Me.txtInteger
            //        Set oText.DataBindings.Add(adoPrimaryRS)
            //        txtInteger_LostFocus oText.Index
            //    Next
            //    For Each oText In Me.txtFloat
            //        Set oText.DataBindings.Add(adoPrimaryRS)
            //        If oText.Text = "" Then oText.Text = "0"
            //        oText.Text = oText.Text * 100
            //        txtFloat_LostFocus oText.Index
            //    Next
            //    For Each oText In Me.txtFloatNegative
            //        Set oText.DataBindings.Add(adoPrimaryRS)
            //        If oText.Text = "" Then oText.Text = "0"
            //        oText.Text = oText.Text * 100
            //        txtFloatNegative_LostFocus oText.Index
            //    Next
            //Bind the check boxes to the data provider
            foreach (CheckBox oCheck_loopVariable in chkFields) {
                oCheck = oCheck_loopVariable;
                oCheck.DataBindings.Add(adoPrimaryRS);
            }
            buildDataControls();
            mbDataChanged = false;

            loadLanguage();
            ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:68,代码来源:frmChannel.cs

示例10: cmdShowHistory_Click

        private void cmdShowHistory_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            int i = 0;
            int x = 0;
            string sql = null;
            string databaseName = null;
            short y = 0;
            short lMonth = 0;
            ADODB.Connection cn = default(ADODB.Connection);
            ADODB.Recordset rs = new ADODB.Recordset();

             // ERROR: Not supported in C#: OnErrorStatement

            if (cmdShowHistory.Text == "&Show Full History") {
                cmdShowHistory.Text = "&Show Current Month";
            } else {
                cmdShowHistory.Text = "&Show Full History";
                cmdsearch_Click(cmdSearch, new System.EventArgs());
                return;
            }

            if (gLoading)
                return;
            gLoading = true;
            Cursor = System.Windows.Forms.Cursors.WaitCursor;
            System.Windows.Forms.Application.DoEvents();

            y = cmbMonth.Items.Count - 1;
            lvTransaction.Items.Clear();
            lblcount.Text = "0 of 0";
            lvTransaction.Visible = false;

            string lPosString = null;
            System.Windows.Forms.ListViewItem lvItem = null;
            //(cmbMonth.ListCount - 1)
            for (i = 0; i <= y; i++) {

                lMonth = Convert.ToInt32(cmbMonth.Items[i]);
                if (lMonth == gMonthEnd) {
                    databaseName = "pricing.mdb";
                } else {
                    databaseName = "Month" + lMonth + ".mdb";
                }

                cn = modRecordSet.openConnectionInstance(ref databaseName);
                if (cn == null) {
                    goto nextMonth;
                    //Exit Sub
                }
                //Dim lString As String
                //Dim lCustomerString As String
                //Dim lStockString As String
                if (this.cmbPOS.SelectedIndex)
                    lPosString = " AND (Sale_PosID=" + cmbPOS.SelectedIndex + ")";

                sql = "SELECT CustomerTransaction.CustomerTransactionID, CustomerTransaction.CustomerTransaction_CustomerID, CustomerTransaction.CustomerTransaction_TransactionTypeID, CustomerTransaction.CustomerTransaction_DayEndID, CustomerTransaction.CustomerTransaction_MonthEndID, CustomerTransaction.CustomerTransaction_ReferenceID, CustomerTransaction.CustomerTransaction_Date, CustomerTransaction.CustomerTransaction_Description, CustomerTransaction.CustomerTransaction_Amount, CustomerTransaction.CustomerTransaction_Reference, CustomerTransaction.CustomerTransaction_PersonName," + " TransactionType.TransactionType_Name, IIf([CustomerTransaction_Amount]>0,[CustomerTransaction_Amount],Null) AS debit, IIf([CustomerTransaction_Amount]<0,[CustomerTransaction_Amount],Null) AS credit FROM CustomerTransaction INNER JOIN TransactionType ON CustomerTransaction.CustomerTransaction_TransactionTypeID = TransactionType.TransactionTypeID WHERE (((CustomerTransaction.CustomerTransaction_CustomerID)=" + adoPrimaryRS.Fields("CustomerID").Value + ")) ORDER BY CustomerTransaction.CustomerTransactionID DESC;";
                Debug.Print(sql);
                rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);

                x = 0;
                //lvTransaction.Visible = False
                while (!(rs.EOF)) {
                    x = x + 1;
                    if (gLoading) {
                    } else {
                        break; // TODO: might not be correct. Was : Exit Do
                    }
                    lblcount.Text = x + " of " + rs.RecordCount;
                    System.Windows.Forms.Application.DoEvents();
                    if (rs.Fields("CustomerTransaction_Reference").Value != "Month End") {
                        lvItem = lvTransaction.Items.Add("K" + rs.Fields("CustomerTransactionID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
                        if (lvItem.SubItems.Count > 1) {
                            lvItem.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
                        } else {
                            lvItem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
                        }
                        if (lvItem.SubItems.Count > 2) {
                            lvItem.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
                        } else {
                            lvItem.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
                        }
                        if (lvItem.SubItems.Count > 3) {
                            lvItem.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
                        } else {
                            lvItem.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
                        }
                        if (lvItem.SubItems.Count > 4) {
                            lvItem.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
                        } else {
                            lvItem.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
                        }
                    }
                    rs.moveNext();
                }
                //lvTransaction.Visible = True
                rs.Close();
                nextMonth:
            }

            lvTransaction.Visible = true;
//.........这里部分代码省略.........
开发者ID:nodoid,项目名称:PointOfSale,代码行数:101,代码来源:frmCustomerAllocPayment.cs

示例11: loadItem

        public void loadItem(ref bool returns)
        {
            System.Windows.Forms.TextBox oText = new System.Windows.Forms.TextBox();

            //ResizeForm frmGRVitem, frmGRVitem.Width, frmGRVitem.Height, 2

            if (returns) {
                orderType = 1;
            } else {
                orderType = 0;
            }

            loading = true;
            setupGRV();

            getNamespace();
            getOrder();

            if (gridItem.RowCount) {
                loading = true;
                gridItem.Col = 0;
                gridItem.row = 0;
                loading = false;
                foreach (TextBox oText_loopVariable in txtEdit) {
                    oText = oText_loopVariable;
                    oText.Visible = false;
                }
                if (gridItem.RowCount > 1) {
                    gridItem.Col = colQuantity;
                    gridItem.row = 1;
                    _txtEdit_0.Visible = true;
                } else {
                }
            }
            loading = false;

            cmdSort.Left = 0;
            cmdStockItem.Left = 0;
            if (modApplication.bolAirTimeGRV == true) {
                tmrAutoGRV.Enabled = true;
            }

            rsPackSize = modRecordSet.getRS(ref "SELECT Company_FNVegShowVol FROM Company;");
            bFNVegPackSize = rsPackSize.Fields("Company_FNVegShowVol").Value;

            //update TotalQtyKG
            modRecordSet.cnnDB.Execute("UPDATE (GRVItem INNER JOIN StockItem ON GRVItem.GRVItem_StockItemID = StockItem.StockItemID) INNER JOIN PackSize ON StockItem.StockItem_PackSizeID = PackSize.PackSizeID SET GRVItem_PackSizeVol=IIf(GRVItem_PackSizeVol=0,PackSize.PackSize_Volume,GRVItem_PackSizeVol) WHERE (((GRVItem.GRVItem_GRVID)=" + My.MyProject.Forms.frmGRV.adoPrimaryRS.Fields("GRVID").Value + "));");

            loadLanguage();
            if (this.Visible) {
            } else {
                this.ShowDialog();
            }
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:54,代码来源:frmGRVitem.cs

示例12: loadItem

        public void loadItem()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);

            System.Windows.Forms.TextBox oText = null;
            System.Windows.Forms.CheckBox oCheck = null;
             // ERROR: Not supported in C#: OnErrorStatement

            //Old
            //Set adoPrimaryRS = getRS("select CompanyID, Company_PosHeading1,Company_PosHeading2,Company_PosHeading3,Company_PosFooter,Company_TaxNumber,Company_PosPrintAccountPayments,Company_PosPrintAccountSales,Company_PosPrintAccountCOD,Company_PosPrintConsignment,Company_PosParameters,Company_POSRecieptPrint from Company")

            //New with text narative
            adoPrimaryRS = modRecordSet.getRS(ref "select CompanyID, Company_PosHeading1,Company_PosHeading2,Company_PosHeading3,Company_PosFooter,Company_TaxNumber,Company_PosPrintAccountPayments,Company_PosPrintAccountSales,Company_PosPrintAccountCOD,Company_PosPrintConsignment,Company_POSExcess,Company_PosParameters,Company_POSRecieptPrint,Company_PosPrintPayouts,Company_PosCentRound from Company");

            setup();
            foreach (TextBox oText_loopVariable in txtFields) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
                oText.MaxLength = adoPrimaryRS.Fields(oText.DataBindings).DefinedSize;
            }
            foreach (TextBox oText_loopVariable in this.txtInteger) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
                oText.Leave += txtInteger_Leave;
                //txtInteger_Leave(txtInteger.Item((oText.Index)), New System.EventArgs())
            }

            foreach (TextBox oText_loopVariable in this.txtPrice) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
                oText.Leave += txtPrice_Leave;
                //txtPrice_Leave(txtPrice.Item((oText.Index)), New System.EventArgs())
            }

            this._txtPrice_0.Text = Strings.FormatNumber(adoPrimaryRS.Fields("Company_POSExcess").Value, 2);

            //_txtFields_9.MaxLength = 7
            _txtFields_9.MaxLength = 8;
            buildDataControls();
            mbDataChanged = false;
            //Me.optPrint(_txtFields_5).Checked = True
            if (_txtFields_5.Text == "0") {
                _optPrint_0.Checked = true;
            } else if (_txtFields_5.Text == "1") {
                _optPrint_1.Checked = true;
            } else {
                _optPrint_2.Checked = true;
            }

            loadLanguage();
            ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:52,代码来源:frmPOSsetup.cs

示例13: TheSelect

        public object TheSelect()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rst = default(ADODB.Recordset);

            rs = new ADODB.Recordset();
            rst = new ADODB.Recordset();

            modApplication.MyLIDWHole = Convert.ToInt16(DataList1.CurrentCell.Value);

            rs = modRecordSet.getRS(ref "SELECT BClabel.*, BClabelItem.* FROM BClabel INNER JOIN BClabelItem ON BClabel.BClabel_LabelID = BClabelItem.BClabelItem_LabelID WHERE BClabelItem.BClabelItem_LabelID=" + modApplication.MyLIDWHole + "");
            modApplication.RecSel = rs.Fields("BClabelID").Value;

            modApplication.TheSelectedPrinterNew = 2;
            My.MyProject.Forms.frmBarcodeLoad.ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:16,代码来源:frmDesign.cs

示例14: loadCompanies

        private void loadCompanies()
        {
            string locationCompany_Name = null;
            int locationCompanyID = 0;
            int x = 0;
            ADODB.Recordset rs = new ADODB.Recordset();
            System.Windows.Forms.ListViewItem lListitem = null;
            rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
            if (openConnection()) {
            }
            rs.Open("SELECT locationCompany.locationCompanyID, location.location_Name, locationCompany.locationCompany_Name, locationCompany.locationCompany_Path FROM location INNER JOIN locationCompany ON location.locationID = locationCompany.locationCompany_LocationID ORDER BY location.location_Name, locationCompany.locationCompany_Name;", cnnDBmaster, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic);

            //Me.lvLocation.ListItems.Clear
            if (rs.RecordCount) {
                x = -1;
                object[,] gArray = new object[rs.RecordCount, 3];
                while (!(rs.EOF)) {
                    x = x + 1;
                    gArray[x, 0] = rs.Fields(locationCompanyID).Value;
                    gArray[x, 1] = rs.Fields(locationCompany_Name).Value + "";
                    gArray[x, 2] = 0;
                    rs.moveNext();
                }
                rs.Close();

                //Do Until rs.EOF
                //    Set lListitem = lvLocation.ListItems.Add(, "k" & rs("locationCompanyID"), rs("locationCompany_Name"), , 2)
                //    lListitem.SubItems(1) = rs("location_Name") & ""
                //    lListitem.SubItems(2) = rs("locationCompany_Path") & ""
                //    If LCase(rs("locationCompany_Path") & "") = LCase(serverPath & "pricing.mdb") Then
                //        lListitem.Selected = True
                //        'lvLocation_DblClick
                //    End If
                //    rs.moveNext
                //Loop
            }
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:37,代码来源:frmSelCompChk.cs

示例15: cmdsearch_Click_Alloc

        private void cmdsearch_Click_Alloc()
        {
            int x = 0;
            string sql = null;
            string databaseName = null;
            short y = 0;
            short lMonth = 0;
            ADODB.Connection cn = default(ADODB.Connection);
            ADODB.Recordset rs = new ADODB.Recordset();

            bSelectPayment = false;
            if (gLoading)
                return;
            gLoading = true;
            Cursor = System.Windows.Forms.Cursors.WaitCursor;
            System.Windows.Forms.Application.DoEvents();
            //lMonth = cmbMonth.ItemData(cmbMonth.ListIndex)
            //If lMonth = gMonthEnd Then
            databaseName = "pricing.mdb";
            //Else
            //    databaseName = "Month" & lMonth & ".mdb"
            //End If

            //Set cn = openConnectionInstance(databaseName)
            //If cn Is Nothing Then
            //    Exit Sub
            //End If
            string lString = null;

            sql = "SELECT CustomerTransaction.CustomerTransactionID, CustomerTransaction.CustomerTransaction_CustomerID, CustomerTransaction.CustomerTransaction_TransactionTypeID, CustomerTransaction.CustomerTransaction_DayEndID, CustomerTransaction.CustomerTransaction_MonthEndID, CustomerTransaction.CustomerTransaction_ReferenceID, CustomerTransaction.CustomerTransaction_Date, CustomerTransaction.CustomerTransaction_Description, CustomerTransaction.CustomerTransaction_Amount, CustomerTransaction.CustomerTransaction_Reference, CustomerTransaction.CustomerTransaction_PersonName, CustomerTransaction.CustomerTransaction_Main, CustomerTransaction.CustomerTransaction_Child, CustomerTransaction.CustomerTransaction_Allocated," + " TransactionType.TransactionType_Name, IIf([CustomerTransaction_Amount]>0,[CustomerTransaction_Amount],Null) AS debit, IIf([CustomerTransaction_Amount]<0,[CustomerTransaction_Amount],Null) AS credit FROM CustomerTransaction INNER JOIN TransactionType ON CustomerTransaction.CustomerTransaction_TransactionTypeID = TransactionType.TransactionTypeID WHERE (((CustomerTransaction.CustomerTransaction_CustomerID)=" + adoPrimaryRS.Fields("CustomerID").Value + ")) ORDER BY CustomerTransaction.CustomerTransactionID DESC;";
            Debug.Print(sql);
            //rs.Open sql, cnnDB, adOpenStatic, adLockReadOnly, adCmdText
            rs = modRecordSet.getRS(ref sql);

            lvTransAlloc.Items.Clear();
            lblcount.Text = "0 of 0";

            System.Windows.Forms.ListViewItem lvItemAlloc = null;
            x = 0;
            lvTransAlloc.Visible = false;
            while (!(rs.EOF)) {
                x = x + 1;
                if (gLoading) {
                } else {
                    break; // TODO: might not be correct. Was : Exit Do
                }
                lblcount.Text = x + " of " + rs.RecordCount;
                System.Windows.Forms.Application.DoEvents();
                //If rs("CustomerTransaction_Reference") = "Month End" Then
                if (rs.Fields("TransactionType_Name").Value == "B/Forward") {
                    if ((Information.IsDBNull(rs.Fields("debit").Value) ? 0 : rs.Fields("debit").Value) == rs.Fields("CustomerTransaction_Allocated").Value & (Information.IsDBNull(rs.Fields("credit").Value) ? 0 : rs.Fields("credit").Value) == 0) {
                        //Else
                        lvItemAlloc = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
                        if (lvItemAlloc.SubItems.Count > 1) {
                            lvItemAlloc.SubItems[1].Text = rs.Fields("CustomerTransaction_Reference").Value;
                        } else {
                            lvItemAlloc.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("CustomerTransaction_Reference").Value));
                        }
                        if (lvItemAlloc.SubItems.Count > 2) {
                            lvItemAlloc.SubItems[2].Text = rs.Fields("TransactionType_Name").Value;
                        } else {
                            lvItemAlloc.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("TransactionType_Name").Value));
                        }
                        //Select Case rs("Sale_PaymentType")
                        //   Case 1
                        //        lvItemAlloc.SubItems(2) = "Cash"
                        //    Case 2
                        //        lvItemAlloc.SubItems(2) = "CR Card"
                        //    Case 3
                        //        lvItemAlloc.SubItems(2) = "DR Card"
                        //    Case 4
                        //        lvItemAlloc.SubItems(2) = "Cheque"
                        //    Case 5
                        //        lvItemAlloc.SubItems(2) = "Account"
                        //    Case 7
                        //        lvItemAlloc.SubItems(2) = "Split Tender"
                        //    Case Else
                        //        lvItemAlloc.SubItems(2) = "Cash"
                        //End Select
                        if (lvItemAlloc.SubItems.Count > 3) {
                            lvItemAlloc.SubItems[3].Text = Strings.FormatNumber(rs.Fields("debit").Value, 4);
                        } else {
                            lvItemAlloc.SubItems.Insert(3, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("debit").Value, 4)));
                        }
                        if (lvItemAlloc.SubItems.Count > 4) {
                            lvItemAlloc.SubItems[4].Text = Strings.FormatNumber(rs.Fields("credit").Value, 4);
                        } else {
                            lvItemAlloc.SubItems.Insert(4, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("credit").Value, 4)));
                        }
                        if (lvItemAlloc.SubItems.Count > 5) {
                            lvItemAlloc.SubItems[5].Text = Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4);
                        } else {
                            lvItemAlloc.SubItems.Insert(5, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Strings.FormatNumber(rs.Fields("CustomerTransaction_Allocated").Value, 4)));
                        }
                    }
                } else if (rs.Fields("TransactionType_Name").Value == "Invoice") {
                    if ((Information.IsDBNull(rs.Fields("debit").Value) ? 0 : rs.Fields("debit").Value) == rs.Fields("CustomerTransaction_Allocated").Value & (Information.IsDBNull(rs.Fields("credit").Value) ? 0 : rs.Fields("credit").Value) == 0) {
                        //Else
                        lvItemAlloc = lvTransAlloc.Items.Add("K" + rs.Fields("CustomerTransactionID").Value + "_" + databaseName + "_" + rs.Fields("CustomerTransaction_ReferenceID").Value + "_" + rs.Fields("CustomerTransaction_TransactionTypeID").Value, Strings.Format(rs.Fields("CustomerTransaction_Date").Value, "yyyy mmm dd hh:mm"), "");
                        if (lvItemAlloc.SubItems.Count > 1) {
//.........这里部分代码省略.........
开发者ID:nodoid,项目名称:PointOfSale,代码行数:101,代码来源:frmCustomerAllocPayment.cs


注:本文中的ADODB.Recordset.Fields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。