• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ADODB.Recordset类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: db_access

        public object[] db_access(string strSQL)
        {
            ADODB.Connection objCon;
            ADODB.Recordset objRec;
            object[,] dataRows;
            object[] dataSuite;
            string strCon;

            objCon = new ADODB.Connection();
            objRec = new ADODB.Recordset();

            //establish the connection string and open the database connection
            strCon = "driver={MySQL ODBC 5.1 Driver};server=107.22.232.228;uid=qa_people;pwd=thehandcontrols;" +
                "database=functional_test_data;option=3";

            objCon.Open(strCon);

            //execute the SQL and return the recrodset of results
            objRec = objCon.Execute(strSQL, out missing, 0);

            //populate a two dinmensional object array with the results
            dataRows = objRec.GetRows();

            //get a one dimensional array that can be placed into the Test Suite dropdown
            dataSuite = thinArray(dataRows);

            //close the recordset
            objRec.Close();

            //close the database connection
            objCon.Close();

            return dataSuite;
        }
开发者ID:modulexcite,项目名称:StudentSuccessDashboard,代码行数:34,代码来源:dbUpdater.cs


示例2: LoadAll

		override internal void LoadAll()
		{
			ADODB.Connection cnn = new ADODB.Connection();
			ADODB.Recordset rs = new ADODB.Recordset();
			ADOX.Catalog cat = new ADOX.Catalog();
    
			// Open the Connection
			cnn.Open(dbRoot.ConnectionString, null, null, 0);
			cat.ActiveConnection = cnn;

			ADOX.Procedure proc = cat.Procedures[this.Procedure.Name];
       
			// Retrieve Parameter information
			rs.Source = proc.Command as ADODB.Command;
			rs.Fields.Refresh();

			Pervasive.PervasiveResultColumn resultColumn;

			if(rs.Fields.Count > 0)
			{
				int ordinal = 0;
			
				foreach(ADODB.Field field in rs.Fields)
				{
					resultColumn = this.dbRoot.ClassFactory.CreateResultColumn() as Pervasive.PervasiveResultColumn;
					resultColumn.dbRoot = this.dbRoot;
					resultColumn.ResultColumns = this;

					resultColumn.name = field.Name;
					resultColumn.ordinal = ordinal++;
					resultColumn.typeName = field.Type.ToString();

					this._array.Add(resultColumn);
				}
			}

			cnn.Close();
		}
开发者ID:attila3453,项目名称:alsing,代码行数:38,代码来源:ResultColumns.cs


示例3: cmdPrev_Click

        private void cmdPrev_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            string sql = null;
            string lString = null;

            mID_Renamed = 0;
            mID_Renamed = My.MyProject.Forms.frmMonthendList.getItem(ref 7);
            if (mID_Renamed) {
                gRS = modRecordSet.getRS(ref "SELECT DayEnd.DayEndID, Format([DayEnd_Date],'ddd dd mmm yyyy') AS theDay FROM DayEnd WHERE DayEnd.DayEnd_MonthEndID = " + mID_Renamed + " ORDER BY DayEnd.DayEndID DESC;");
                //Display the list of Titles in the DataCombo
                DataList1.DataSource = gRS;
                DataList1.listField = "theDay";

                //Bind the DataCombo to the ADO Recordset
                //UPGRADE_ISSUE: VBControlExtender property DataList1.DataSource is not supported at runtime. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="74E732F3-CAD8-417B-8BC9-C205714BB4A7"'
                DataList1.DataSource = gRS;
                DataList1.boundColumn = "DayEndID";
            } else {
                gRS = modRecordSet.getRS(ref "SELECT DayEnd.DayEndID, Format([DayEnd_Date],'ddd dd mmm yyyy') AS theDay FROM Company AS Company_1 INNER JOIN (Company RIGHT JOIN DayEnd ON Company.Company_DayEndID = DayEnd.DayEndID) ON Company_1.Company_MonthEndID = DayEnd.DayEnd_MonthEndID Where (((Company.CompanyID) Is Null)) ORDER BY DayEnd.DayEndID DESC;");
                //Display the list of Titles in the DataCombo
                DataList1.DataSource = gRS;
                DataList1.listField = "theDay";

                //Bind the DataCombo to the ADO Recordset
                DataList1.DataSource = gRS;
                DataList1.boundColumn = "DayEndID";
            }
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:28,代码来源:frmDayEndListNew.cs


示例4: RefreshLoad

        public object RefreshLoad(ref short Index)
        {
            // ERROR: Not supported in C#: OnErrorStatement

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

            rs = new ADODB.Recordset();

            rst = new ADODB.Recordset();
            //TheSelectedPrinterNew = 0
            rs = modRecordSet.getRS(ref "SELECT * FROM Label WHERE Label.Label_Type=" + Index + " ORDER BY LabelID");

            DataList1.DataSource = rs;
            DataList1.listField = "Label_Name";

            //Bind the DataCombo to the ADO Recordset

            //UPGRADE_ISSUE: VBControlExtender property DataList1.DataSource is not supported at runtime. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="74E732F3-CAD8-417B-8BC9-C205714BB4A7"'
            DataList1.DataSource = rs;
            DataList1.boundColumn = "LabelID";
            //if the Type was Shelf Talker set option button to true else set Barcode option button to true
            if (modApplication.TheType == 1) {
                this.option1[1].Checked = true;
            } else if (modApplication.TheType == 2) {
                this.option1[2].Checked = true;
            }

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


示例5: loadADORecordset

 public static ADODB.Recordset loadADORecordset(string filepath)
 {
     ADODB.Recordset record = new ADODB.Recordset();
     const int adCmdFile = 256;
     ((ADODB.Recordset)record).Open(filepath, "Provider=MSPersist;", ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic, adCmdFile);
     return record;
 }
开发者ID:mescalitog,项目名称:xTangoFacturas,代码行数:7,代码来源:Commons.cs


示例6: 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


示例7: getRSwaitron

 public static ADODB.Recordset getRSwaitron(ref object sql, ref ADODB.Connection cn)
 {
     ADODB.Recordset functionReturnValue = default(ADODB.Recordset);
     functionReturnValue = new ADODB.Recordset();
     functionReturnValue.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
     functionReturnValue.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic);
     return functionReturnValue;
 }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:8,代码来源:modRecordSet.cs


示例8: getRS

 public static ADODB.Recordset getRS(ref string sql)
 {
     ADODB.Recordset functionReturnValue = default(ADODB.Recordset);
     functionReturnValue = new ADODB.Recordset();
     functionReturnValue.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
     functionReturnValue.Open(sql, cnnDB, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic, -1);
     return functionReturnValue;
     //Debug.Print(sql)
 }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:9,代码来源:modRecordSet.cs


示例9: 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


示例10: loadItem

        public void loadItem(ref int id)
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            int lID = 0;
            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 PriceSet.PriceSetID, PriceSet.PriceSet_Name, PriceSet.PriceSet_StockItemID, PriceSet.PriceSet_Disabled From PriceSet WHERE (((PriceSet.PriceSetID)=" + id + "));");
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from [PriceSet]");
                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;
            }

            //Bind the check boxes to the data provider
            foreach (CheckBox oCheck_loopVariable in chkFields) {
                oCheck = oCheck_loopVariable;
                lID = adoPrimaryRS.Fields("PriceSet_StockItemID").Value;
                if (lID != 0) {
                    rs = modRecordSet.getRS(ref "SELECT StockItem.StockItem_Name FROM StockItem WHERE (StockItemID = " + lID + ")");
                    if (rs.BOF | rs.EOF) {
                        this.lblStockItem.Text = "No Stock Item Selected ...";
                        this.lblStockItem.Tag = 0;
                    } else {
                        this.lblStockItem.Text = rs("StockItem_Name");
                        this.lblStockItem.Tag = lID;
                    }

                }
                oCheck.DataBindings.Add(adoPrimaryRS);
            }
            if (_chkFields_0.CheckState == 2)
                _chkFields_0.CheckState = System.Windows.Forms.CheckState.Unchecked;
            buildDataControls();
            mbDataChanged = false;
            setup();

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


示例11: MyLoad

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

            rs = modRecordSet.getRS(ref "SELECT * FROM Label WHERE Label.Label_Type=" + 2 + "");

            DataList1.DataSource = rs;
            DataList1.listField = "Label_Name";

            //Bind the DataCombo to the ADO Recordset
            //UPGRADE_ISSUE: VBControlExtender property DataList1.DataSource is not supported at runtime. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="74E732F3-CAD8-417B-8BC9-C205714BB4A7"'
            DataList1.DataSource = rs;
            DataList1.boundColumn = "LabelID";

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


示例12: getRSreport

        public static ADODB.Recordset getRSreport(ref string sql)
        {
            ADODB.Recordset functionReturnValue = default(ADODB.Recordset);
            string Path = null;
            string strDBPath = null;
             // ERROR: Not supported in C#: OnErrorStatement

            functionReturnValue = new ADODB.Recordset();
            functionReturnValue.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
            Debug.Print(sql);
            functionReturnValue.Open(sql, cnnDBreport, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic);
            return functionReturnValue;
            getRSreport_Error:

            if (cnnDBreport == null) {
                Interaction.MsgBox(Err().Number + " " + Err().Description + " " + Err().Source + Constants.vbCrLf + Constants.vbCrLf + " cnnDBreport object has not been made.");
            } else if (Err().Description == "Not a valid password.") {
                Interaction.MsgBox("Error while getRSreport and Error is :" + Err().Number + " " + Err().Description + " " + Err().Source + Constants.vbCrLf + Constants.vbCrLf + cnnDBreport.ConnectionString + Constants.vbCrLf + Constants.vbCrLf + " --- " + cnnDBreport.State);

                modRecordSet.cnnDB.Close();
                //UPGRADE_NOTE: Object cnnDB may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
                modRecordSet.cnnDB = null;
                modRecordSet.cnnDB = new ADODB.Connection();
                //UPGRADE_WARNING: Couldn't resolve default property of object strDBPath. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                strDBPath = modRecordSet.serverPath + "pricing.mdb";
                //UPGRADE_WARNING: Couldn't resolve default property of object strDBPath. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                //UPGRADE_WARNING: Couldn't resolve default property of object Path. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Path = strDBPath + ";Jet " + "OLEDB:Database Password=lqd";
                //cnnDB.CursorLocation = adUseClient
                //UPGRADE_WARNING: Couldn't resolve default property of object Path. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                modRecordSet.cnnDB.Open("Provider=Microsoft.ACE.OLEDB.12.0;Mode=Share Deny Read|Share Deny Write;Persist Security Info=False;Data Source= " + Path);
                modRecordSet.cnnDB.Execute("ALTER DATABASE PASSWORD Null " + " " + "lqd");
                modRecordSet.cnnDB.Close();
                //UPGRADE_NOTE: Object cnnDB may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
                modRecordSet.cnnDB = null;
                modRecordSet.openConnection();

            } else {
                Interaction.MsgBox("Error while getRSreport and Error is :" + Err().Number + " " + Err().Description + " " + Err().Source + Constants.vbCrLf + Constants.vbCrLf + cnnDBreport.ConnectionString + Constants.vbCrLf + Constants.vbCrLf + " --- " + cnnDBreport.State);
            }
             // ERROR: Not supported in C#: ResumeStatement

            return functionReturnValue;
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:44,代码来源:modReport.cs


示例13: 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


示例14: cmdCancel_Click

        private void cmdCancel_Click()
        {
            bool mbDataChanged = false;
            int mvBookMark = 0;
            ADODB.Recordset adoPrimaryRS = new ADODB.Recordset();
            bool mbAddNewFlag = false;
            bool mbEditFlag = false;
             // ERROR: Not supported in C#: OnErrorStatement

            if (mbAddNewFlag) {
                this.Close();
            } else {
                mbEditFlag = false;
                mbAddNewFlag = false;
                adoPrimaryRS.CancelUpdate();
                if (mvBookMark > 0) {
                    adoPrimaryRS.Bookmark = mvBookMark;
                } else {
                    adoPrimaryRS.MoveFirst();
                }
                mbDataChanged = false;
            }
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:23,代码来源:frmCashTransactionItem.cs


示例15: 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


示例16: getRSMaster

 public ADODB.Recordset getRSMaster(ref string sql)
 {
     ADODB.Recordset functionReturnValue = default(ADODB.Recordset);
     functionReturnValue = new ADODB.Recordset();
     functionReturnValue.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
     functionReturnValue.Open(sql, cnnDBmaster, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic);
     return functionReturnValue;
 }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:8,代码来源:frmMaster.cs


示例17: loadCompanies

 private void loadCompanies()
 {
     ADODB.Recordset rs = new ADODB.Recordset();
     System.Windows.Forms.ListViewItem lListitem = null;
     rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
     //If openConnection Then
     //End If
     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);
     //If lvLocation.Items.Count <> 0 Then
     //Me.lvLocation.Items.Clear()
     //End If
     if (rs.RecordCount) {
         while (!(rs.EOF)) {
             lListitem = lvLocation.Items.Add("k" + rs.Fields("locationCompanyID").Value, rs.Fields("locationCompany_Name").Value, 2);
             if (lListitem.SubItems.Count > 0) {
                 lListitem.SubItems[0].Text = rs.Fields("location_Name").Value + "";
             } else {
                 lListitem.SubItems.Insert(0, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("location_Name").Value + ""));
             }
             if (lListitem.SubItems.Count > 1) {
                 lListitem.SubItems[1].Text = rs.Fields("locationCompany_Path").Value + "";
             } else {
                 lListitem.SubItems.Insert(1, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, rs.Fields("locationCompany_Path").Value + ""));
             }
             if (Strings.LCase(rs.Fields("locationCompany_Path").Value + "") == Strings.LCase(modRecordSet.serverPath + "pricing.mdb")) {
                 lListitem.Selected = true;
                 lvLocation_DoubleClick(lvLocation, new System.EventArgs());
             }
             rs.MoveNext();
         }
     }
 }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:32,代码来源:frmMaster.cs


示例18: getRSreport1

        public static ADODB.Recordset getRSreport1(ref object sql)
        {
            ADODB.Recordset functionReturnValue = default(ADODB.Recordset);
             // ERROR: Not supported in C#: OnErrorStatement

            functionReturnValue = new ADODB.Recordset();
            functionReturnValue.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
            functionReturnValue.Open(sql, cnnDBConsReport, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic);
            return functionReturnValue;
            getRSreport1_Error:

            if (cnnDBConsReport == null) {
                Interaction.MsgBox(Err().Number + " " + Err().Description + " " + Err().Source + Constants.vbCrLf + Constants.vbCrLf + " cnnDBConsReport object has not been made.");
            } else {
                Interaction.MsgBox("Error while getRSreport1 and Error is :" + Err().Number + " " + Err().Description + " " + Err().Source + Constants.vbCrLf + Constants.vbCrLf + " --- " + cnnDBConsReport.ConnectionString + Constants.vbCrLf + Constants.vbCrLf + " --- " + cnnDBConsReport.State);
            }
             // ERROR: Not supported in C#: ResumeStatement

            return functionReturnValue;
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:20,代码来源:modReport.cs


示例19: doSearch

        private void doSearch()
        {
            string sql = null;
            string lString = null;
            lString = Strings.Trim(txtSearch.Text);
            lString = Strings.Replace(lString, "  ", " ");
            lString = Strings.Replace(lString, "  ", " ");
            lString = Strings.Replace(lString, "  ", " ");
            lString = Strings.Replace(lString, "  ", " ");
            lString = Strings.Replace(lString, "  ", " ");
            lString = Strings.Replace(lString, "  ", " ");

            if (string.IsNullOrEmpty(Strings.Trim(txtSearch.Text))) {
                lString = gFilterSQL;
            } else {
                lString = "(StockItem_Name LIKE '%" + Strings.Replace(lString, " ", "%' AND StockItem_Name LIKE '%") + "%')";
                if (string.IsNullOrEmpty(gFilterSQL)) {
                    lString = " WHERE " + lString;
                } else {
                    lString = gFilterSQL + " AND " + lString;
                }
            }
            if (gAll) {
            } else {
                if (string.IsNullOrEmpty(lString)) {
                    lString = " WHERE StockItem.StockItem_Disabled = 0 Or StockItem.StockItem_Discontinued = 0 ";
                } else {
                    lString = lString + " AND (StockItem.StockItem_Disabled = 0 Or StockItem.StockItem_Discontinued = 0) ";
                }
            }
            gRS = modRecordSet.getRS(ref "SELECT DISTINCT StockItemID, StockItem_Name FROM StockItem " + lString + " ORDER BY StockItem_Name");
            if (gRS.RecordCount) {
            } else {
                if (string.IsNullOrEmpty(Strings.Trim(txtSearch.Text))) {
                } else {
                    if (Information.IsNumeric(txtSearch.Text)) {
                        lString = Strings.Trim(txtSearch.Text);
                        lString = Strings.Replace(lString, "  ", " ");
                        lString = Strings.Replace(lString, "  ", " ");
                        lString = Strings.Replace(lString, "  ", " ");
                        lString = Strings.Replace(lString, "  ", " ");
                        lString = Strings.Replace(lString, "  ", " ");
                        lString = Strings.Replace(lString, "  ", " ");
                        lString = "WHERE (Catalogue_Barcode LIKE '%" + Strings.Replace(lString, " ", "%' AND StockItem_Name LIKE '%") + "%')";
                        if (gAll) {
                        } else {
                            lString = lString + " AND StockItem.StockItem_Disabled = 0 And StockItem.StockItem_Discontinued = 0 ";
                        }

                        gRS = modRecordSet.getRS(ref "SELECT DISTINCT StockItem.StockItemID, StockItem.StockItem_Name FROM Catalogue INNER JOIN StockItem ON Catalogue.Catalogue_StockItemID = StockItem.StockItemID " + lString + " ORDER BY StockItem.StockItem_Name;");
                    }
                }
            }
            //Display the list of Titles in the DataCombo
            DataList1.DataSource = gRS;
            DataList1.listField = "StockItem_Name";

            //Bind the DataCombo to the ADO Recordset
            //UPGRADE_ISSUE: VBControlExtender property DataList1.DataSource is not supported at runtime. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="74E732F3-CAD8-417B-8BC9-C205714BB4A7"'
            DataList1.DataSource = gRS;
            DataList1.boundColumn = "StockItemID";
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:62,代码来源:frmStockList2.cs


示例20: loadItem


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AD_PROCESS_ID类代码示例发布时间:2022-05-24
下一篇:
C# AC类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap