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;
        }
Ejemplo n.º 2
2
		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();
		}
Ejemplo n.º 3
0
        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) {
                gID = id;
                adoPrimaryRS = modRecordSet.getRS(ref "select * from Deposit WHERE DepositID = " + id);
            } else {
                gID = 0;
                adoPrimaryRS = modRecordSet.getRS(ref "select * from Deposit");
                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;
            }
            foreach (TextBox oText_loopVariable in txtHide) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
            }
            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
            foreach (CheckBox oCheck_loopVariable in chkFields) {
                oCheck = oCheck_loopVariable;
                oCheck.DataBindings.Add(adoPrimaryRS);
            }
            buildDataControls();
            mbDataChanged = false;

            loadLanguage();
            ShowDialog();
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        public bool loadItem()
        {
            string sql = null;
            gUpdate = true;
            string lString = "";

            sql = "SELECT PricingGroup.PricingGroup_Name AS Department, StockItem.StockItem_Name, Catalogue.Catalogue_Barcode, Catalogue.Catalogue_Quantity, StockItem.StockItem_ListCost, Vat.Vat_Amount, POSCatalogueChannelLnk.POSCatalogueChannelLnk_Price, [Catalogue_Quantity]/[StockItem_Quantity]*[StockItem_ListCost] AS cost, [Catalogue_Quantity]/[StockItem_Quantity]*[StockItem_ListCost] AS exclusiveCost, [Catalogue_Quantity]/[StockItem_Quantity]*[StockItem_ListCost]*(1+[Vat_Amount]/100) AS inclusiveCost, IIf([POSCatalogueChannelLnk_Price],([POSCatalogueChannelLnk_Price]-[Catalogue_Quantity]/[StockItem_Quantity]*[StockItem_ListCost]*(1+[Vat_Amount]/100))/[POSCatalogueChannelLnk_Price]*100) AS gpPercentage, ([POSCatalogueChannelLnk_Price]-[Catalogue_Quantity]/[StockItem_Quantity]*[StockItem_ListCost]*(1+[Vat_Amount]/100)) AS profit, Channel.Channel_Name, Channel.ChannelID ";
            sql = sql + "FROM Channel INNER JOIN ((Vat INNER JOIN (POSCatalogueChannelLnk INNER JOIN ((StockItem INNER JOIN PricingGroup ON StockItem.StockItem_PricingGroupID = PricingGroup.PricingGroupID) INNER JOIN Catalogue ON StockItem.StockItemID = Catalogue.Catalogue_StockItemID) ON (POSCatalogueChannelLnk.POSCatalogueChannelLnk_StockItemID = Catalogue.Catalogue_StockItemID) AND (POSCatalogueChannelLnk.POSCatalogueChannelLnk_Quantity = Catalogue.Catalogue_Quantity)) ON Vat.VatID = StockItem.StockItem_VatID) LEFT JOIN StockitemOverwrite ON StockItem.StockItemID = StockitemOverwrite.StockitemOverwriteID) ON Channel.ChannelID = POSCatalogueChannelLnk.POSCatalogueChannelLnk_ChannelID ";
            sql = sql + "WHERE (((([POSCatalogueChannelLnk_Price]-[Catalogue_Quantity]/[StockItem_Quantity]*[StockItem_ListCost]*(1+[Vat_Amount]/100)))<=0) AND ((StockitemOverwrite.StockitemOverwriteID) Is Null) AND ((StockItem.StockItem_Disabled)=False) AND ((Channel.Channel_Disabled)=False) AND ((Channel.ChannelID)<>9) AND ((Catalogue.Catalogue_Disabled)=False));";

            gRS = modRecordSet.getRS(ref sql);
            if (gRS.RecordCount) {
                lString = lString + "There are " + gRS.RecordCount + " catalogue prices where your price is equal or less that the products cost price." + Constants.vbCrLf + Constants.vbCrLf;
            }
            sql = "SELECT PricingGroup.PricingGroup_Name AS Department, StockItem.StockItem_Name, Catalogue.Catalogue_Barcode, Catalogue.Catalogue_Quantity, StockItem.StockItem_ListCost, Vat.Vat_Amount, CatalogueChannelLnk.CatalogueChannelLnk_Price, Channel.Channel_Name, Channel.ChannelID ";
            sql = sql + "FROM Channel INNER JOIN ((Vat INNER JOIN (CatalogueChannelLnk INNER JOIN ((StockItem INNER JOIN PricingGroup ON StockItem.StockItem_PricingGroupID = PricingGroup.PricingGroupID) INNER JOIN Catalogue ON StockItem.StockItemID = Catalogue.Catalogue_StockItemID) ON (CatalogueChannelLnk.CatalogueChannelLnk_StockItemID = Catalogue.Catalogue_StockItemID) AND (CatalogueChannelLnk.CatalogueChannelLnk_Quantity = Catalogue.Catalogue_Quantity)) ON Vat.VatID = StockItem.StockItem_VatID) INNER JOIN StockitemOverwrite ON StockItem.StockItemID = StockitemOverwrite.StockitemOverwriteID) ON Channel.ChannelID = CatalogueChannelLnk.CatalogueChannelLnk_ChannelID ";
            sql = sql + "WHERE (((CatalogueChannelLnk.CatalogueChannelLnk_Price)=0) AND ((Channel.ChannelID)<>9) AND ((StockItem.StockItem_Disabled)=False) AND ((Channel.Channel_Disabled)=False) AND ((Catalogue.Catalogue_Disabled)=False));";
            gRSsq = modRecordSet.getRS(ref sql);
            if (gRSsq.RecordCount) {
                lString = lString + "There are " + gRS.RecordCount + " SQ catalogue prices set to ZERO." + Constants.vbCrLf + Constants.vbCrLf;
            }
            if (!string.IsNullOrEmpty(lString)) {
                lString = lString + "It is not advisable to post any changes to your Point Of Sale devices until you have resolved this prices.";
                this.lblDesc.Text = lString;
                ShowDialog();
            }
            return gUpdate;
        }
Ejemplo n.º 6
0
        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 StockGroup WHERE StockGRoupID = " + id);
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from StockGroup");
                adoPrimaryRS.AddNew();
                this.Text = this.Text + " [New record]";
                mbAddNewFlag = true;
            }
            setup();
            BindingSource bind = new BindingSource();
            foreach (TextBox oText_loopVariable in this.txtFields) {
                oText = oText_loopVariable;
                bind.DataSource = adoPrimaryRS;
                oText.DataBindings.Add(bind.DataSource);
                oText.MaxLength = adoPrimaryRS.Fields(oText.DataBindings).DefinedSize;
            }

            foreach (CheckBox oCheck_loopVariable in this.chkFields) {
                oCheck = oCheck_loopVariable;
                oCheck.DataBindings.Add(bind.DataSource);
            }

            buildDataControls();
            mbDataChanged = false;

            loadLanguage();
            ShowDialog();
        }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
        public void loadItem(ref int id)
        {
            System.Windows.Forms.TextBox oText = null;
            System.Windows.Forms.CheckBox oCheck = null;
            if (id) {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from PrintGroup WHERE PrintGroupID = " + id);
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from PrintGroup");
                adoPrimaryRS.AddNew();
                this.Text = this.Text + " [New record]";
                mbAddNewFlag = true;
            }
            setup();
            foreach (TextBox oText_loopVariable in this.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;
            }
            buildDataControls();
            mbDataChanged = false;

            loadLanguage();
            ShowDialog();
        }
Ejemplo n.º 9
0
        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";
            }
        }
Ejemplo n.º 10
0
        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();
        }
Ejemplo n.º 11
0
 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;
 }
Ejemplo n.º 12
0
 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)
 }
Ejemplo n.º 13
0
        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) {
                pRid = id;
                adoPrimaryRS = modRecordSet.getRS(ref "select PricingGroupID,PricingGroup_Name,PricingGroup_RemoveCents,PricingGroup_RoundAfter,PricingGroup_RoundDown,PricingGroup_Unit1,PricingGroup_Case1,PricingGroup_Unit2,PricingGroup_Case2,PricingGroup_Unit3,PricingGroup_Case3,PricingGroup_Unit4,PricingGroup_Case4,PricingGroup_Unit5,PricingGroup_Case5,PricingGroup_Unit6,PricingGroup_Case6,PricingGroup_Unit7,PricingGroup_Case7,PricingGroup_Unit8,PricingGroup_Case8,PricingGroup_Disabled from PricingGroup WHERE PricingGroupID = " + id);
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from PricingGroup");
                adoPrimaryRS.AddNew();
                this.Text = this.Text + " [New record]";
                mbAddNewFlag = true;
            }
            setup();
            foreach (TextBox oText_loopVariable in this.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;
            }
            foreach (TextBox oText_loopVariable in this.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;
            }
            foreach (TextBox oText_loopVariable in this.txtFloatNegative) {
                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 += txtFloatNegative_Leave;
            }

            if (Convert.ToInt16(adoPrimaryRS.Fields("PricingGroup_Disabled").Value)) {
                this.chkPricing.CheckState = System.Windows.Forms.CheckState.Checked;
                this.chkPricing.Tag = 1;
            } else {
                this.chkPricing.Tag = 0;
            }

            buildDataControls();
            mbDataChanged = false;

            loadLanguage();
            ShowDialog();
        }
Ejemplo n.º 14
0
        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;
        }
Ejemplo n.º 15
0
        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 Pricelist WHERE PricelistID = " + id);
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from Pricelist");
                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;
            }
            //    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;
            if (this.cmbDelivery.SelectedIndex == -1) {
                chkChannel.CheckState = System.Windows.Forms.CheckState.Unchecked;
                cmbDelivery.Enabled = false;
            } else {
                chkChannel.CheckState = System.Windows.Forms.CheckState.Checked;
                cmbDelivery.Enabled = true;
            }

            loadLanguage();
            ShowDialog();
        }
Ejemplo n.º 16
0
        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();
        }
Ejemplo n.º 17
0
        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();
        }
Ejemplo n.º 18
0
 private void buildDataControls()
 {
     ADODB.Recordset rs = default(ADODB.Recordset);
     //doDataControl Me.cmbDeposit, "SELECT DepositID, Deposit_Name FROM Deposit WHERE ((LEFT((Deposit.Deposit_Name),3)<>'Non')) ORDER BY Deposit_Name", "Set_DepositID", "DepositID", "Deposit_Name"
     doDataControl(ref (this.cmbDeposit), ref "SELECT DepositID, Deposit_Name FROM Deposit WHERE ((Deposit.Deposit_Disabled) <> True) ORDER BY Deposit_Name", ref "Set_DepositID", ref "DepositID", ref "Deposit_Name");
     if (adoPrimaryRS.Fields("Set_StockitemID").Value > 0)
     {
         chkStockItem.Tag        = adoPrimaryRS.Fields("Set_StockitemID").Value;
         chkStockItem.CheckState = System.Windows.Forms.CheckState.Checked;
         chkStockItem.Tag        = "";
         //        Set rs = getRS("SELECT * FROM StockItem WHERE StockItemID=" & adoPrimaryRS("Set_StockitemID"))
         //        If rs.RecordCount Then
         //            lblStockItem.Caption = rs("StockItem_Name")
         //        End If
     }
 }
Ejemplo n.º 19
0
        public void makeItem()
        {
            int lID = 0;

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

            bApplyChk = false;
            lID       = My.MyProject.Forms.frmStockList.getItem();
            if (lID != 0)
            {
                // ERROR: Not supported in C#: OnErrorStatement

                loadItem(lID);
                //adoPrimaryRS("PromotionID"), lID
            }
        }
Ejemplo n.º 20
0
        /// <summary>   Returns RecordSet for CommandText and optional Parameter Collection. </summary>
        ///<example>
        /// <code>
        /// class TestClass{
        /// static void Main(){
        ///   WD.DataAccess.Context.DbContext dbContext=new WD.DataAccess.Context.DbContext();
        ///   using(ADODB.Recordset recordSet=dbContext.ICommands.ExecuteRecordSet("Select columnNames from tableName")){
        ///     //write your code
        ///
        ///   }
        ///   //or
        ///   WD.DataAccess.Parameters.DBParameter[] aParams=new WD.DataAccess.Parameters.DBParameter[1];
        ///   aParams[0]=new WD.DataAccess.Parameters.DBParameter();
        ///   aParams[0].ParameterName="FirstName";
        ///   aParams[0].ParameterValue="first name";
        ///   using(ADODB.Recordset recordSet=dbContext.ICommands.ExecuteRecordSet("Select columnNames from tableName
        ///   where FirstName=@FirstName",aParams);{
        ///     //write your code
        ///
        ///   }
        /// }
        /// }
        /// </code>
        ///</example>
        /// <remarks>   Asim Naeem, 7/20/2017. </remarks>
        ///
        /// <param name="commandText">  Open Sql Statement or Procedure Name. </param>
        /// <param name="aParams">      (Optional) Collection of Optional Parameters. </param>
        ///
        /// <returns>   Active RecordSet Object. </returns>


        public virtual ADODB.Recordset ExecuteRecordSet(string commandText, DBParameter[] aParams = null)
        {
            ADODB.Recordset recordSet = null;
            try
            {
                using (IDbConnection dbConnection = CreateConnection())
                {
                    recordSet = ExecuteRecordSet(commandText, CommandType.Text, dbConnection, (IDbTransaction)null, aParams);
                }
            }
            catch
            {
                throw;
            }
            return(recordSet);
        }
Ejemplo n.º 21
0
        private void cmdAdd_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            int lID = 0;

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

            lID = My.MyProject.Forms.frmStockList.getItem();
            if (lID != 0)
            {
                // ERROR: Not supported in C#: OnErrorStatement

                //cnnDB.Execute "INSERT INTO PromotionItem ( PromotionItem_PromotionID, PromotionItem_StockItemID, PromotionItem_Quantity, PromotionItem_Price ) SELECT " & adoPrimaryRS("PromotionID") & " AS [Set], CatalogueChannelLnk.CatalogueChannelLnk_StockItemID, 1,CatalogueChannelLnk.CatalogueChannelLnk_Price From CatalogueChannelLnk WHERE (((CatalogueChannelLnk.CatalogueChannelLnk_StockItemID)=" & lID & ") AND ((CatalogueChannelLnk.CatalogueChannelLnk_Quantity)=1) AND ((CatalogueChannelLnk.CatalogueChannelLnk_ChannelID)=1));"
                My.MyProject.Forms.frmPromotionItem.loadItem(adoPrimaryRS.Fields("PromotionID").Value, lID);
                loadItems(lID);
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Method to get the triggering attribute ANO
        /// </summary>
        /// <returns></returns>
        private int GetTriggeringANO()
        {
            int iReturnANO = 0;

            ADODB.Recordset rs = m_oApp.DataContext.MetadataRecordset("G3E_ATTRIBUTEINFO_OPTABLE", "G3E_NAME = '" + m_sComponentName + "' AND G3E_FIELD = '" + m_sFieldName + "'");
            // rs.Filter = "G3E_NAME = '" + m_sComponentName + "' AND G3E_FIELD = '" + m_sFieldName + "'";
            if (rs != null)
            {
                if (rs.RecordCount > 0)
                {
                    rs.MoveFirst();
                    iReturnANO = Convert.ToInt32(rs.Fields["G3E_ANO"].Value);
                }
            }
            return(iReturnANO);
        }
Ejemplo n.º 23
0
        public Status(ADODB.Recordset rs)
        {
            m_Status = ObjectStatus.Closed;
            if (rs != null && rs.State != (int)ADODB.ObjectStateEnum.adStateClosed)
            {
                if ((rs.State & (int)ADODB.ObjectStateEnum.adStateOpen) == (int)ADODB.ObjectStateEnum.adStateOpen)
                {
                    m_Status |= ObjectStatus.Open;
                }

                if ((rs.State | (int)ADODB.ObjectStateEnum.adStateOpen) != (int)ADODB.ObjectStateEnum.adStateOpen)
                {
                    m_Status |= ObjectStatus.Busy;
                }
            }
        }
Ejemplo n.º 24
0
        private bool IsWPExist(string p_StrucureID)
        {
            bool bReturn = false;

            ADODB.Recordset rs = m_oApp.DataContext.OpenRecordset("select count(*) from workpoint_n where structure_id = ?", ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic, (int)ADODB.CommandTypeEnum.adCmdText, p_StrucureID);

            if (rs != null)
            {
                if (rs.RecordCount > 0)
                {
                    rs.MoveFirst();
                    bReturn = Convert.ToInt32(rs.Fields[0].Value) == 1;
                }
            }
            return(bReturn);
        }
        private void loadData()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rj = default(ADODB.Recordset);

            rs = modRecordSet.getRS(ref "SELECT StockItem.StockItem_Name, StockItem_Quantity FROM StockItem WHERE ((StockItem.StockItemID)=" + gStockItemID + ");");
            if (rs.RecordCount)
            {
                lblStockItem.Text = rs.Fields("StockItem_Name").Value;
                txtPSize.Text     = rs.Fields("StockItem_Quantity").Value;
                this.Height       = sizeConvertors.twipsToPixels(2520, false);

                loadLanguage();
                ShowDialog();
            }
        }
Ejemplo n.º 26
0
        public void buildCriteria(ref string filter_Renamed)
        {
            ADODB.Recordset rs     = default(ADODB.Recordset);
            ADODB.Recordset RSitem = default(ADODB.Recordset);
            gHeading  = "";
            gCriteria = "";
            // ERROR: Not supported in C#: OnErrorStatement

            rs = modRecordSet.getRS(ref "SELECT ftSet.* From ftSet Where (((ftSet.ftSet_Group) = '" + Strings.Replace(filter_Renamed, "'", "''") + "')) ORDER BY ftSet.ftSet_Order;");
            if (rs.BOF | rs.EOF)
            {
            }
            else
            {
                while (!(rs.EOF))
                {
                    RSitem = modRecordSet.getRS(ref "SELECT * From ftData WHERE (((ftData.ftData_PersonID)=" + modRecordSet.gPersonID + ") AND ((ftData.ftData_FieldName)='" + Strings.Replace(rs.Fields("ftSet_Name").Value, "'", "''") + "'));");

                    if (RSitem.BOF | RSitem.EOF)
                    {
                    }
                    else
                    {
                        gHeading  = gHeading + " AND " + RSitem.Fields("ftData_Heading").Value;
                        gCriteria = gCriteria + " AND " + Strings.Replace(RSitem.Fields("ftData_SQL").Value, "[field]", rs.Fields("ftSet_Field").Value);
                    }
                    RSitem.Close();
                    rs.moveNext();
                }
            }
            rs.Close();

            if (Strings.Left(gCriteria, 5) == " AND ")
            {
                gCriteria = Strings.Mid(gCriteria, 6);
            }
            if (!string.IsNullOrEmpty(gCriteria))
            {
                gCriteria = " WHERE " + gCriteria;
            }
            if (!string.IsNullOrEmpty(gHeading))
            {
                gHeading = Strings.Mid(gHeading, 6);
            }

            //New code
        }
        private void report_WHTransfer()
        {
            ADODB.Recordset rs  = default(ADODB.Recordset);
            string          sql = null;

            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = default(CrystalDecisions.CrystalReports.Engine.ReportDocument);
            Report.Load("cryWHTransfer.rpt");
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            rs = modRecordSet.getRS(ref "SELECT Company.Company_Name FROM Company;");
            Report.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
            rs.Close();

            Report.SetParameterValue("txtFrom", lblWHA.Text);
            Report.SetParameterValue("txtTo", lblWHB.Text);
            Report.SetParameterValue("txtPerson", My.MyProject.Forms.frmMenu.lblUser);

            sql = "SELECT HandheldWHTransfer.HandHeldID, StockItem.StockItem_Name, HandheldWHTransfer.Quantity";
            sql = sql + " FROM HandheldWHTransfer INNER JOIN StockItem ON HandheldWHTransfer.HandHeldID = StockItem.StockItemID WHERE (((HandheldWHTransfer.WHouseID)=" + lWHB + "));";
            Debug.Print(sql);
            rs = modRecordSet.getRS(ref sql);

            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = default(CrystalDecisions.CrystalReports.Engine.ReportDocument);
            ReportNone.Load("cryNoRecords.rpt");
            if (rs.BOF | rs.EOF)
            {
                ReportNone.SetParameterValue("txtCompanyName", Report.ParameterFields("txtCompanyName").ToString);
                ReportNone.SetParameterValue("txtTitle", Report.ParameterFields("txtTitle").ToString);
                My.MyProject.Forms.frmReportShow.Text = ReportNone.ParameterFields("txtTitle").ToString;
                My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = ReportNone;
                My.MyProject.Forms.frmReportShow.mReport = ReportNone;
                My.MyProject.Forms.frmReportShow.sMode   = "0";
                My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                My.MyProject.Forms.frmReportShow.ShowDialog();
                return;
            }
            Report.Database.Tables(1).SetDataSource(rs);

            //Report.VerifyOnEveryPrint = True
            My.MyProject.Forms.frmReportShow.Text = Report.ParameterFields("txtTitle").ToString;
            My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = Report;
            My.MyProject.Forms.frmReportShow.mReport = Report;
            My.MyProject.Forms.frmReportShow.sMode   = "0";
            My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            My.MyProject.Forms.frmReportShow.ShowDialog();
        }
        public void loadItem(ref int id)
        {
            short x = 0;

            ADODB.Recordset rs = default(ADODB.Recordset);
            gID = id;
            rs  = modRecordSet.getRS(ref "SELECT Pricelist_Name FROM PricelistFilter WHERE PricelistID = " + gID);
            if (rs.BOF | rs.EOF)
            {
            }
            else
            {
                lblHeading.Text = rs.Fields("Pricelist_Name").Value;
                rs        = modRecordSet.getRS(ref "SELECT TOP 100 PERCENT StockItem.StockItemID, StockItem.StockItem_Name FROM StockItem ORDER BY StockItem_Name;");
                dataArray = new int[rs.RecordCount + 1, 3];
                x         = -1;
                while (!(rs.EOF))
                {
                    x = x + 1;
                    dataArray[x, 0] = rs.Fields("StockItemID").Value;
                    //UPGRADE_WARNING: Couldn't resolve default property of object x. 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 dataArray(x, 1). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    dataArray[x, 1] = rs.Fields("StockItem_Name").Value;
                    dataArray[x, 2] = false;
                    rs.moveNext();
                }


                rs = modRecordSet.getRS(ref "SELECT PricelistFilterStockItemLnk.PricelistStockItemLnk_StockItemID From PricelistFilterStockItemLnk WHERE (((PricelistFilterStockItemLnk.PricelistStockItemLnk_PricelistID)=" + gID + "));");
                while (!(rs.EOF))
                {
                    for (x = Information.LBound(dataArray); x <= Information.UBound(dataArray); x++)
                    {
                        if (dataArray[x, 0] == rs.Fields("PricelistStockItemLnk_StockItemID").Value)
                        {
                            dataArray[x, 2] = true;
                        }
                    }
                    rs.moveNext();
                }

                doLoad();

                loadLanguage();
                ShowDialog();
            }
        }
Ejemplo n.º 29
0
        private void cmdShrinkAdd_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            short  lAmount = 0;
            short  x       = 0;
            string lString = null;

            ADODB.Recordset rs = default(ADODB.Recordset);
            lAmount = 1;
            lString = "1";
            for (x = 0; x <= txtInteger.Count; x++)
            {
                if (Convert.ToInt16(txtInteger[x].Text) != 0)
                {
                    lString = lString + "x" + txtInteger[x].Text;
                    if (Convert.ToInt16(txtInteger[x].Text) <= lAmount)
                    {
                        Interaction.MsgBox(Convert.ToInt16(txtInteger[x].Text) + " is less than or equal to " + lAmount + ".", MsgBoxStyle.Exclamation, "Error");
                        return;
                    }
                    else
                    {
                        lAmount = Convert.ToInt16(txtInteger[x].Text);
                    }
                }
            }
            //    lString = Mid(lString, 2)
            rs = modRecordSet.getRS(ref "SELECT TOP 100 PERCENT Shrink.Shrink_Name From Shrink WHERE (((Shrink.Shrink_Name)='" + lString + "'));");
            if (rs.RecordCount)
            {
                Interaction.MsgBox("Shrink size '" + lString + "' already loaded!", MsgBoxStyle.Exclamation, "Error");
            }
            else
            {
                modRecordSet.cnnDB.Execute("INSERT INTO shrink ( Shrink_Name, Shrink_SystemID ) SELECT TOP 100 PERCENT '" + lString + "' AS Expr1, 0 AS Expr2;");
                rs      = modRecordSet.getRS(ref "SELECT TOP 100 PERCENT Max(Shrink.ShrinkID) AS MaxOfShrinkID FROM Shrink;");
                lAmount = rs.Fields(0).Value;
                modRecordSet.cnnDB.Execute("INSERT INTO ShrinkItem ( ShrinkItem_ShrinkID, ShrinkItem_Quantity, ShrinkItem_Code ) SELECT TOP 100 PERCENT " + lAmount + " AS Expr1, 1  AS Expr2, '' AS Expr3;");
                for (x = 0; x <= txtInteger.Count; x++)
                {
                    if (Convert.ToInt16(txtInteger[x].Text) != 0)
                    {
                        modRecordSet.cnnDB.Execute("INSERT INTO ShrinkItem ( ShrinkItem_ShrinkID, ShrinkItem_Quantity, ShrinkItem_Code ) SELECT TOP 100 PERCENT " + lAmount + " AS Expr1, " + txtInteger[x].Text + " AS Expr2, '' AS Expr3;");
                    }
                }
                this.Close();
            }
        }
Ejemplo n.º 30
0
    public void endWhatif_Equipment()
    {
        ADODB.Recordset recdata = null;
        string          selectedTableValues;

        selectedTableValues = " SELECT zztblEquip.EquipDept AS v1, tblEquip.EquipDept AS v2, 'EquipDept' AS Fa, 'Equip Dept' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '10' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((tblEquip.EquipDept)<>[zztblEquip].[Equipdept]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[EquipComment] AS v1, tblEquip.[EquipComment] AS v2, 'EqComment' AS Fa, 'Equipment Comment' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '10' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE ((([EquipÇomment])<>[zztblEquip].[Equipcomment]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[E1] AS v1, tblEquip.[E1] AS v2, 'E1' AS Fa, 'Equip Parameter E1' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '10' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[E1])<>[zztblEquip].[E1]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[E2] AS v1, tblEquip.[E2] AS v2, 'E2' AS Fa, 'Equip Parameter E2' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '10' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[E2])<>[zztblEquip].[E2]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[E3] AS v1, tblEquip.[E3] AS v2, 'E3' AS Fa, 'Equip Parameter E3' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '10' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[E3])<>[zztblEquip].[E3]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[E4] AS v1, tblEquip.[E4] AS v2, 'E4' AS Fa, 'Equip Parameter E4' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '10' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[E4])<>[zztblEquip].[E4]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[setup] AS v1, tblEquip.[setup] AS v2, 'setup' AS Fa, 'Setup Time Multipler' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '6' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[setup])<>[zztblEquip].[setup]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[run] AS v1, tblEquip.[run] AS v2, 'run' AS Fa, 'run Time Multipler' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '6' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[run])<>[zztblEquip].[run]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[OT] AS v1, tblEquip.[OT] AS v2, 'OT' AS Fa, 'Overtime %' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '6' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[OT])<>[zztblEquip].[OT]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[MTF] AS v1, tblEquip.[MTF] AS v2, 'MTF' AS Fa, 'Mean Time To (between) Failures' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '6' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[MTF])<>[zztblEquip].[MTF]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[MTR] AS v1, tblEquip.[MTR] AS v2, 'MTR' AS Fa, 'Mean Time To Repair' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '6' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[MTR])<>[zztblEquip].[MTR]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[GrpSiz] AS v1, tblEquip.[GrpSiz] AS v2, 'GrpSiz' AS Fa, 'No. in Group (Size)' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '6' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[GrpSiz])<>[zztblEquip].[GrpSiz]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[varbility] AS v1, tblEquip.[varbility] AS v2, 'varbility' AS Fa, 'Equip Only Variability Multipler' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '6' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[varbility])<>[zztblEquip].[varbility]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblEquip.[Labor] AS v1, tblEquip.[Labor] AS v2, 'Labor' AS Fa, 'Assigned Labor Group' AS Fe, 'Equipment' as Te, 'tblEquip' AS Ta, tblEquip.Equipid AS recid, '3' AS type FROM tblEquip INNER JOIN zztblEquip ON tblEquip.EquipID = zztblEquip.EquipID WHERE (((zztblEquip.[Labor])<>[zztblEquip].[Labor]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);
    }
Ejemplo n.º 31
0
    public void endWhatif_Products()
    {
        ADODB.Recordset recdata = null;
        string          selectedTableValues;

        selectedTableValues = " SELECT zztblProdFore.ProdDept AS v1, tblProdFore.ProdDept AS v2, 'ProdDept' AS Fa, 'Product Dept' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '10' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((tblProdFore.ProdForeDept)<>[zztblProdFore].[ProdForedept]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[ProdComment] AS v1, tblProdFore.[ProdComment] AS v2, 'ProdComment' AS Fa, 'Product Comment' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '10' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE ((([ProdForeÇomment])<>[zztblProdFore].[ProdForecomment]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[P1] AS v1, tblProdFore.[P1] AS v2, 'P1' AS Fa, 'Product Parameter P1' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '10' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[P1])<>[zztblProdFore].[P1]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[P2] AS v1, tblProdFore.[P2] AS v2, 'P2' AS Fa, 'Product Parameter P2' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '10' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[P2])<>[zztblProdFore].[P2]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[P3] AS v1, tblProdFore.[P3] AS v2, 'P3' AS Fa, 'Product Parameter P3' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '10' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[P3])<>[zztblProdFore].[P3]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[P4] AS v1, tblProdFore.[P4] AS v2, 'P4' AS Fa, 'Product Parameter P4' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '10' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[P4])<>[zztblProdFore].[P4]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[LotsizeFac] AS v1, tblProdFore.[LotsizeFac] AS v2, 'LotsizeFac' AS Fa, 'Lot size Multipler' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '6' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[LotsizeFac])<>[zztblProdFore].[LotsizeFac]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[DemandFac] AS v1, tblProdFore.[DemandFac] AS v2, 'DemandFac' AS Fa, 'Demand Multipler' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '6' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[DemandFac])<>[zztblProdFore].[DemandFac]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[EndDemd] AS v1, tblProdFore.[EndDemd] AS v2, 'EndDemd' AS Fa, 'End Use (shipped) Demand' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '6' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[EndDemd])<>[zztblProdFore].[EndDemd]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[Lotsiz] AS v1, tblProdFore.[Lotsiz] AS v2, 'Lotsiz' AS Fa, 'Starting Lot Size' as fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '6' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[Lotsiz])<>[zztblProdFore].[Lotsiz]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[MTR] AS v1, tblProdFore.[MTR] AS v2, 'MTR' AS Fa, 'Mean Time To Repair' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '6' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[MTR])<>[zztblProdFore].[MTR]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[GrpSiz] AS v1, tblProdFore.[GrpSiz] AS v2, 'GrpSiz' AS Fa, 'No. in Group (Size)' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '6' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[GrpSiz])<>[zztblProdFore].[GrpSiz]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[varbility] AS v1, tblProdFore.[varbility] AS v2, 'varbility' AS Fa, 'ProdFore Only Variability Multipler' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '6' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[varbility])<>[zztblProdFore].[varbility]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);

        selectedTableValues = " SELECT zztblProdFore.[Labor] AS v1, tblProdFore.[Labor] AS v2, 'Labor' AS Fa, 'Assigned Labor Group' AS Fe, 'Product' as Te, 'tblProdFore' AS Ta, tblProdFore.prodid AS recid, '3' AS type FROM tblProdFore INNER JOIN zztblProdFore ON tblProdFore.prodid = zztblProdFore.prodid WHERE (((zztblProdFore.[Labor])<>[zztblProdFore].[Labor]));";
        InsertWhatifRecord(selectedTableValues, ref recdata);
    }
Ejemplo n.º 32
0
        private void StammdatenForm_Load(object sender, EventArgs e)
        {
            //Recordset
            ADODB.Connection cn = new ADODB.Connection();
            ADODB.Recordset  rs = new ADODB.Recordset();

            //Connection string.
            cn.Open(cnStr);

            rs.Open("Select * From Artikelstammdaten", cn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, -1);

            int i = 0;

            while (!rs.EOF)
            {
                metroGrid1.Rows.Add();
                metroGrid1.Rows[i].Cells["Artikelnummer"].Value        = Convert.ToInt32(rs.Fields["Artikelnummer"].Value);
                metroGrid1.Rows[i].Cells["Bezeichnung"].Value          = rs.Fields["Bezeichnung"].Value;
                metroGrid1.Rows[i].Cells["Verwendung"].Value           = rs.Fields["Verwendung"].Value;
                metroGrid1.Rows[i].Cells["Lieferkosten"].Value         = rs.Fields["Lieferkosten"].Value;
                metroGrid1.Rows[i].Cells["Lieferzeit"].Value           = rs.Fields["Lieferzeit"].Value;
                metroGrid1.Rows[i].Cells["Lieferzeitabweichung"].Value = rs.Fields["Lieferzeitabweichung"].Value;
                rs.MoveNext();
                ++i;
            }
            i = 0;
            rs.Close();
            rs.Open("Select * From PersMaschKosten", cn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, -1);
            while (!rs.EOF)
            {
                metroGrid4.Rows.Add();
                metroGrid4.Rows[i].Cells["Arbeitsplatz"].Value = Convert.ToInt32(rs.Fields["Arbeitsplatz"].Value);
                metroGrid4.Rows[i].Cells["Lohn1"].Value        = Convert.ToDouble(rs.Fields["1Lohn"].Value);
                metroGrid4.Rows[i].Cells["Lohn2"].Value        = Convert.ToDouble(rs.Fields["2Lohn"].Value);
                metroGrid4.Rows[i].Cells["Lohn3"].Value        = Convert.ToDouble(rs.Fields["3Lohn"].Value);
                metroGrid4.Rows[i].Cells["ÜLohn"].Value        = Convert.ToDouble(rs.Fields["ÜLohn"].Value);
                metroGrid4.Rows[i].Cells["varKosten"].Value    = Convert.ToDouble(rs.Fields["varKosten"].Value);
                metroGrid4.Rows[i].Cells["fixeKosten"].Value   = Convert.ToDouble(rs.Fields["fixeKosten"].Value);
                rs.MoveNext();
                ++i;
            }
            rs.Close();
            cn.Close();


            refreshComboBox1();
        }
        private void getNamespace()
        {
            if (string.IsNullOrEmpty(cmbShrink.BoundText))
            {
                return;
            }
            string lString = null;

            lString = " ((Catalogue.Catalogue_Quantity)=" + this.cmbShrink.BoundText + ") ";
            if (string.IsNullOrEmpty(gFilter))
            {
                this.lblHeading.Text = "";
            }
            else
            {
                My.MyProject.Forms.frmFilter.buildCriteria(ref gFilter);
                this.lblHeading.Text = My.MyProject.Forms.frmFilter.gHeading;
            }
            gFilterSQL = My.MyProject.Forms.frmFilter.gCriteria;
            if (string.IsNullOrEmpty(gFilterSQL))
            {
                lString = " WHERE StockItem.StockItem_Disabled=0 AND StockItem.StockItem_Discontinued=0 ";
            }
            else
            {
                lString = gFilterSQL + " AND StockItem.StockItem_Disabled=0 AND StockItem.StockItem_Discontinued=0 ";
            }

            adoPrimaryRS = modRecordSet.getRS(ref "SELECT StockItem.StockItem_Name, Catalogue.Catalogue_Barcode, Catalogue.Catalogue_Disabled, Catalogue.Catalogue_StockItemID, Catalogue.Catalogue_Quantity FROM StockItem INNER JOIN Catalogue ON StockItem.StockItemID = Catalogue.Catalogue_StockItemID " + lString + " ORDER BY StockItem.StockItem_Name;");

            grdDataGrid.DataSource = adoPrimaryRS;
            grdDataGrid.Columns[0].DataPropertyName           = "Stock Name";
            grdDataGrid.Columns[0].DefaultCellStyle.Alignment = MSDataGridLib.AlignmentConstants.dbgLeft;
            //grdDataGrid.Columns(0).Frozen = True

            grdDataGrid.Columns[1].DataPropertyName           = "Barcode";
            grdDataGrid.Columns[1].DefaultCellStyle.Alignment = MSDataGridLib.AlignmentConstants.dbgRight;
            grdDataGrid.Columns[1].Width = sizeConvertors.twipsToPixels(1400, true);

            grdDataGrid.Columns[2].Visible = false;
            grdDataGrid.Columns[3].Visible = false;
            grdDataGrid.Columns[4].Visible = false;

            frmStockMultiBarcode_Resize(this, new System.EventArgs());
            mbDataChanged = false;
        }
Ejemplo n.º 34
0
        private void frmGRVimport_Load(System.Object eventSender, System.EventArgs eventArgs)
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            rs = modRecordSet.getRS(ref "SELECT DISTINCT SupplierID, Supplier_Name FROM Supplier ORDER BY Supplier_Name");
            //Display the list of Titles in the DataCombo
            DataList1.DataSource = rs;
            DataList1.listField  = "Supplier_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 = "SupplierID";

            loadLanguage();
            loadGRV();
        }
Ejemplo n.º 35
0
        public void DoCostingUpdate()
        {
            ADODB.Recordset rj = default(ADODB.Recordset);

            rj = modRecordSet.getRS(ref "SELECT StockItem.StockItem_ListCost, StockItem.StockItem_ActualCost FROM (StockItem INNER JOIN Catalogue ON StockItem.StockItemID = Catalogue.Catalogue_StockItemID) INNER JOIN FRIENDYFOODHALL ON Catalogue.Catalogue_Barcode = FRIENDYFOODHALL.BARCODE WHERE FRIENDYFOODHALL.BARCODE IS NOT NULL;");

            if (rj.RecordCount)
            {
                if (Interaction.MsgBox("Your about to update [ " + rj.RecordCount + " ] Records do you want to continue?", MsgBoxStyle.ApplicationModal + MsgBoxStyle.YesNo + MsgBoxStyle.Question, _4PosBackOffice.NET.My.MyProject.Application.Info.Title) == MsgBoxResult.Yes)
                {
                    modRecordSet.cnnDB.Execute("UPDATE (StockItem INNER JOIN Catalogue ON [StockItem].[StockItemID]=[Catalogue].[Catalogue_StockItemID]) INNER JOIN FRIENDYFOODHALL ON [Catalogue].[Catalogue_Barcode]=[FRIENDYFOODHALL].[BARCODE] SET StockItem.StockItem_ListCost = [FRIENDYFOODHALL]![CostPrice], StockItem.StockItem_ActualCost = [FRIENDYFOODHALL]![CostPrice] WHERE [FRIENDYFOODHALL].[BARCODE] IS NOT NULL;");
                    modRecordSet.cnnDB.Execute("UPDATE StockItem SET StockItem_ActualCost = 1,StockItem_ListCost= 1 WHERE StockItem.StockItem_ListCost = 0 OR  StockItem.StockItem_ListCost = 0;");
                    Interaction.MsgBox("Update Completed successfully");
                    modRecordSet.cnnDB.Execute("DROP TABLE FRIENDYFOODHALL");
                }
            }
        }
Ejemplo n.º 36
0
        public void loadItem(ref int id)
        {
            short x = 0;

            ADODB.Recordset rs = default(ADODB.Recordset);
            gID = id;
            rs  = modRecordSet.getRS(ref "SELECT Set_Name FROM [Set] WHERE SetID = " + gID);
            if (rs.BOF | rs.EOF)
            {
            }
            else
            {
                lblHeading.Text = rs.Fields("Set_Name").Value;
                //        Set rs = getRS("SELECT TOP 100 PERCENT StockItem.StockItemID, StockItem.StockItem_Name, IIf(IsNull(SetItem_StockItemID), 0, SetItem_StockItemID) AS SetItemID FROM [SELECT TOP 100 PERCENT " & gID & " AS SetID, StockItemID, StockItem_Name From StockItem ORDER BY StockItem_Name]. AS StockItem LEFT JOIN SetItem ON (StockItem.StockItemID = SetItem.SetItem_StockItemID) AND (StockItem.SetID = SetItem.SetItem_SetID);")
                rs        = modRecordSet.getRS(ref "SELECT TOP 100 PERCENT StockItem.StockItemID, StockItem.StockItem_Name FROM StockItem ORDER BY StockItem_Name;");
                dataArray = new short[rs.RecordCount + 1, 3];
                x         = -1;
                while (!(rs.EOF))
                {
                    x = x + 1;
                    dataArray[x, 0] = rs.Fields("StockItemID").Value;
                    dataArray[x, 1] = rs.Fields("StockItem_Name").Value;
                    dataArray[x, 2] = false;
                    rs.moveNext();
                }


                rs = modRecordSet.getRS(ref "SELECT SetItem.SetItem_StockItemID From SetItem WHERE (((SetItem.SetItem_SetID)=" + gID + "));");
                while (!(rs.EOF))
                {
                    for (x = Information.LBound(dataArray); x <= Information.UBound(dataArray); x++)
                    {
                        if (dataArray[x, 0] == rs.Fields("SetItem_StockItemID").Value)
                        {
                            dataArray[x, 2] = true;
                        }
                    }
                    rs.moveNext();
                }

                doLoad();

                loadLanguage();
                ShowDialog();
            }
        }
Ejemplo n.º 37
0
        private void frmGRVItemQuick_Load(System.Object eventSender, System.EventArgs eventArgs)
        {
            adoPrimaryRS = modRecordSet.getRS(ref "SELECT  StockItem_ListCost, StockItem_ListCost / StockItem_Quantity AS StockItem_UnitCost, StockItem_Quantity From StockItem Where (StockItemID = " + My.MyProject.Forms.frmGRVitem.gridItem.get_RowData(ref My.MyProject.Forms.frmGRVitem.gridItem.row) + ")");
            if (adoPrimaryRS.BOF | adoPrimaryRS.EOF)
            {
                this.Close();
            }
            else
            {
                loadLanguage();

                this.lblName.Text = My.MyProject.Forms.frmGRVitem.gridItem.get_TextMatrix(ref My.MyProject.Forms.frmGRVitem.gridItem.row, ref My.MyProject.Forms.frmGRVitem.colName);
                if (My.MyProject.Forms.frmGRVitem.gridItem.get_TextMatrix(ref My.MyProject.Forms.frmGRVitem.gridItem.row, ref My.MyProject.Forms.frmGRVitem.colBrokenPack) == "X")
                {
                    chkBreakPack.CheckState = System.Windows.Forms.CheckState.Checked;
                }
                else
                {
                    chkBreakPack.CheckState = System.Windows.Forms.CheckState.Unchecked;
                }
                chkBreakPack.Tag           = chkBreakPack.CheckState;
                this.txtQuantity.Text      = My.MyProject.Forms.frmGRVitem.gridItem.get_TextMatrix(ref My.MyProject.Forms.frmGRVitem.gridItem.row, ref My.MyProject.Forms.frmGRVitem.colQuantity);
                this.txtDiscountMinus.Text = Strings.FormatNumber(0, 2);
                if (My.MyProject.Forms.frmGRVitem.gridItem.get_ColWidth(ref My.MyProject.Forms.frmGRVitem.colDiscount))
                {
                    this.txtDiscountPlus.Text = Strings.FormatNumber(My.MyProject.Forms.frmGRVitem.gridItem.get_TextMatrix(ref My.MyProject.Forms.frmGRVitem.gridItem.row, ref My.MyProject.Forms.frmGRVitem.colDiscount), 2);
                }
                else if (My.MyProject.Forms.frmGRVitem.gridItem.get_ColWidth(ref My.MyProject.Forms.frmGRVitem.colDiscountLine))
                {
                    this.txtDiscountPlus.Text = Strings.FormatNumber(My.MyProject.Forms.frmGRVitem.gridItem.get_TextMatrix(ref My.MyProject.Forms.frmGRVitem.gridItem.row, ref My.MyProject.Forms.frmGRVitem.colDiscountLine), 2);
                }
                else if (My.MyProject.Forms.frmGRVitem.gridItem.get_ColWidth(ref My.MyProject.Forms.frmGRVitem.colDiscountPercentage))
                {
                    this.txtDiscountPlus.Text = Strings.FormatNumber(My.MyProject.Forms.frmGRVitem.gridItem.get_TextMatrix(ref My.MyProject.Forms.frmGRVitem.gridItem.row, ref My.MyProject.Forms.frmGRVitem.colDiscountPercentage), 2);
                }
                else
                {
                    this.txtDiscountPlus.Text = Convert.ToString(0);
                }
                chkBreakPack_CheckStateChanged(chkBreakPack, new System.EventArgs());
                txtQuantity.Tag      = Convert.ToInt16(txtQuantity.Text);
                txtPrice.Tag         = Convert.ToDecimal(txtPrice.Text);
                txtDiscountMinus.Tag = Convert.ToDecimal(txtDiscountMinus.Text);
                txtDiscountPlus.Tag  = Convert.ToDecimal(txtDiscountPlus.Text);
            }
        }
        private void ErgebnisseForm_LoadKennzahl(ADODB.Connection cn, ADODB.Recordset rs)
        {
            rs.Open("Select * From summary", cn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, -1);
            int i = 0;

            while (!rs.EOF)
            {
                metroGrid1.Rows.Add();
                metroGrid1.Rows[i].Cells["Gewinn"].Value             = rs.Fields["profit_current"].Value;
                metroGrid1.Rows[i].Cells["GewinnDurchschnitt"].Value = rs.Fields["profit_average"].Value;
                metroGrid1.Rows[i].Cells["GewinnGesamt"].Value       = rs.Fields["profit_all"].Value;
                rs.MoveNext();
                ++i;
            }
            i = 0;
            rs.Close();
        }
Ejemplo n.º 39
0
        /// <summary>
        /// Call DB Stored Procedure to generate Polygon Geometries for Detail Foorprint component
        /// </summary>
        /// <param name="g3eFid"></param>
        /// <param name="detailID"></param>
        /// <param name="xCoord"></param>
        /// <param name="yCoord"></param>
        /// <param name="mhType"></param>
        private void PlaceManholeFootprint(int g3eFid, int detailID, double xCoord, double yCoord, string mhType)
        {
            ADODB.Command cmd        = null;
            int           outRecords = 0;
            string        sqlString  = string.Format("Begin FootPrintDetailPlacement.AddManholeDetailFootprint({0},{1},'{2}',{3},{4}); End;", g3eFid, detailID, mhType, xCoord, yCoord);

            try
            {
                cmd             = new ADODB.Command();
                cmd.CommandText = sqlString;
                ADODB.Recordset results = _dataContext.ExecuteCommand(cmd, out outRecords);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 40
0
        //-----------------------------------------------------------------------------------------------------------------------
        // 제목 : Connection 과 Recordset 을 닫는 함수
        //
        // 인자 : rs - Recordset
        //-----------------------------------------------------------------------------------------------------------------------
        public static void CloseAll(ref ADODB.Recordset Rs, short TransAction)
        {
            try
            {
                //RecordSet 해제
                if (CN.State != (int)ADODB.ObjectStateEnum.adStateClosed)
                {
                    switch (TransAction)
                    {
                    case 0:
                        CN.Close();
                        break;

                    case 1:
                        CN.CommitTrans();     //CommitTrans
                        break;

                    case 2:
                        CN.RollbackTrans();     //RollbackTrans
                        break;
                    }
                }

                CN = null;

                if (Rs != null)
                {
                    if (Rs.State != (int)ADODB.ObjectStateEnum.adStateClosed)
                    {
                        Rs.Close();
                    }
                }
                //ADO 연결 해제 (1= Commit, 2=Rollback)
                CloseCN(TransAction);
            }
            catch (Exception)
            {
                //MessageBox.Show(e.Message + "\n Data Base Error!", "확인");
                //CloseAll(ref Rs, 0);
                Rs.Close();
                CN.Close();
            }
            finally
            {
            }
        }
Ejemplo n.º 41
0
        private void carregarUsuarios()
        {
            gridUsuarios.Rows.Clear();

            ADODB.Recordset usuario = DB.fnExecuteSQL("select * from [dbo].[a1_usuarios]");

            while (!usuario.EOF)
            {
                gridUsuarios.Rows.Add(
                    usuario.Fields["a1_codigo"].Value,
                    usuario.Fields["a1_nome"].Value,
                    usuario.Fields["a1_senha"].Value
                    );

                usuario.MoveNext();
            }
        }
    public static bool CalculationsCancelled(string cookieid)
    {
        bool cancelled = false;

        ADODB.Connection connMySql = new ADODB.Connection();
        ADODB.Recordset  recMySql  = new ADODB.Recordset();
        DbUse.OpenAdoMysql(connMySql);
        DbUse.OpenAdoRec(connMySql, recMySql, "SELECT usercalc.cancel FROM usercalc INNER JOIN userlist ON userlist.id = usercalc.id WHERE userlist.sessionid =  '" + HttpContext.Current.Session.SessionID + "';");
        try
        {
            cancelled = !recMySql.Fields["cancel"].Value.ToString().Equals("0");
        }
        catch (Exception) { }
        DbUse.CloseAdoRec(recMySql);
        DbUse.CloseAdo(connMySql);
        return(cancelled);
    }
Ejemplo n.º 43
0
 private void SetServiceman(dynamic obj, string pracOpeKod)
 {
     ADODB.Recordset rs = optima.Execute("select PRI_PraId from CDN.Pracidx where PRI_Kod = '" + pracOpeKod + "' and PRI_Typ = 1");
     if (rs.RecordCount == 1)
     {
         obj.SerwisantTyp = 3;
         obj.SerwisantId  = int.Parse(rs.Fields["PRI_PraId"].Value.ToString());
     }
     else if (rs.RecordCount == 0)
     {
         throw new Exception("Nie znaleziono pracownika o kodzie [" + pracOpeKod + "]");
     }
     else
     {
         throw new Exception("Błąd! Znaleziono " + rs.RecordCount + " pracowników o kodzie [" + pracOpeKod + "]");
     }
 }
Ejemplo n.º 44
0
 //TODO: Дописать экранирование спецсимволов
 public static ADODB.Recordset Select(string sql)
 {
     ADODB.Recordset rs = new ADODB.Recordset
     {
         CursorLocation = ADODB.CursorLocationEnum.adUseClient
     };
     try
     {
         rs.Open(sql, CnMain, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly);
         return(rs);
     }
     catch
     {
         WriteLog.writeStringInLog("Ошибка выполнения запроса: " + sql);
         return(null);
     }
 }
Ejemplo n.º 45
0
        private static bool InsertIntoAsketPorTimeEntries()
        {
            string Select = "select з.IdPorAsket, тз.IssueId, ТЗ.Spent_On,тз.Hours, Ф.UserName ,  тз.Comments + ' Импортировано из Redmine. ' as Comments, тз.id" +
                            " from      " + DB.TABLE_REDMINE_TIME_ENTRIES + " as ТЗ " +
                            " left join " + DB.TABLE_REDMINE_USERS + "  as П on тз.UserId = п.id " +
                            " left join " + DB.TABLE_ASKET_USERS + " as Ф On п.IdUserFromFam = Ф.код " +
                            " left join " + DB.TABLE_REDMINE_ISSUES + "  as З on ТЗ.IssueId = З.id " +
                            " where Deleted = 0 and InsertIntoAsketPor = 0 and з.idPorAsket is not null ";

            ADODB.Recordset rsSelect = DB.Select(Select);
            if (rsSelect == null)
            {
                return(false);
            }
            ADODB.Recordset RsAddPor = DB.Update("select top 1 Код, КодПоручения, Дата, Часов, Кто, Примечания from " + DB.TABLE_REPORT_DEVELOPER);
            if (RsAddPor == null)
            {
                return(false);
            }
            ADODB.Recordset RsUpdateTimeEntries = DB.Update("Select Id, InsertIntoAsketPor,IdRazrabAsket from  " + DB.TABLE_REDMINE_TIME_ENTRIES + " where Deleted = 0 and InsertIntoAsketPor = 0 and IdRazrabAsket =0");
            if (RsUpdateTimeEntries == null)
            {
                return(false);
            }
            while (!(rsSelect.EOF))
            {
                RsAddPor.AddNew();
                RsAddPor.Fields["КодПоручения"].Value = rsSelect.Fields["IdPorAsket"].Value;
                RsAddPor.Fields["Дата"].Value         = rsSelect.Fields["Spent_On"].Value;
                RsAddPor.Fields["Часов"].Value        = rsSelect.Fields["Hours"].Value;
                RsAddPor.Fields["Кто"].Value          = rsSelect.Fields["UserName"].Value;
                RsAddPor.Fields["Примечания"].Value   = rsSelect.Fields["Comments"].Value;
                RsAddPor.Update();
                RsUpdateTimeEntries.Filter = "id = " + rsSelect.Fields["id"].Value;
                if (RsUpdateTimeEntries.RecordCount == 1)
                {
                    RsUpdateTimeEntries.Fields["InsertIntoAsketPor"].Value = true;
                    RsUpdateTimeEntries.Fields["IdRazrabAsket"].Value      = RsAddPor.Fields["Код"].Value;
                    RsUpdateTimeEntries.Update();
                }
                rsSelect.MoveNext();
            }
            rsSelect.Close();
            RsAddPor.Close();
            return(true);
        }
Ejemplo n.º 46
0
        private void LoadExtraDataForView()
        {
            try
            {
                if (this._array.Count > 0)
                {
                    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;

                    rs.Source = cat.Views[this.View.Name].Command;
                    rs.Fields.Refresh();
                    ADODB.Fields flds = rs.Fields;

                    Column col = this._array[0] as Column;

                    f_TypeName = new DataColumn("TYPE_NAME", typeof(string));
                    col._row.Table.Columns.Add(f_TypeName);

                    f_AutoKey = new DataColumn("AUTO_INCREMENT", typeof(Boolean));
                    col._row.Table.Columns.Add(f_AutoKey);

                    Column      c   = null;
                    ADODB.Field fld = null;

                    int count = this._array.Count;
                    for (int index = 0; index < count; index++)
                    {
                        fld = flds[index];
                        c   = (Column)this[fld.Name];

                        c._row["TYPE_NAME"]      = fld.Type.ToString();
                        c._row["AUTO_INCREMENT"] = false;
                    }

                    rs.Close();
                    cnn.Close();
                }
            }
            catch {}
        }
Ejemplo n.º 47
0
        public void loadItem(ref int id)
        {
            System.Windows.Forms.TextBox oText = null;
            DateTimePicker oDate = null;
            System.Windows.Forms.CheckBox oCheck = null;

            mbAddNewFlagID = false;

             // ERROR: Not supported in C#: OnErrorStatement

            if (id) {
                p_Prom = id;
                adoPrimaryRS = modRecordSet.getRS(ref "select GRVPromotion.* from GRVPromotion WHERE PromotionID = " + id);
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from GRVPromotion");
                adoPrimaryRS.AddNew();
                this.Text = this.Text + " [New record]";
                mbAddNewFlag = true;
                mbAddNewFlagID = true;
            }
            setup();
            foreach (TextBox oText_loopVariable in txtFields) {
                oText = oText_loopVariable;
                oText.DataBindings.Add(adoPrimaryRS);
                oText.MaxLength = adoPrimaryRS.Fields(oText.DataBindings).DefinedSize;
            }

            foreach (DateTimePicker oDate_loopVariable in DTFields) {
                oDate = oDate_loopVariable;
                oDate.DataBindings.Add(adoPrimaryRS);
            }

            //adoPrimaryRS("Promotion_SpeTime")
            //Bind the check boxes to the data provider
            foreach (CheckBox oCheck_loopVariable in chkFields) {
                oCheck = oCheck_loopVariable;
                oCheck.DataBindings.Add(adoPrimaryRS);
            }
            buildDataControls();
            mbDataChanged = false;
            loadItems();

            loadLanguage();
            ShowDialog();
        }
Ejemplo n.º 48
0
        public void loadItem(ref int id)
        {
            System.Windows.Forms.TextBox oText = null;
            System.Windows.Forms.CheckBox oCheck = null;
            if (id) {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from VAT WHERE VATID = " + id);
            } else {
                adoPrimaryRS = modRecordSet.getRS(ref "select * from VAT");
                adoPrimaryRS.AddNew();
                this.Text = this.Text + " [New record]";
                mbAddNewFlag = true;
            }
            setup();
            oText = _txtFields_0;
            oText.DataBindings.Add(adoPrimaryRS);
            oText.MaxLength = adoPrimaryRS.Fields(oText.DataBindings).DefinedSize;
            //Next oText
            //    For Each oText In Me.txtInteger
            //        Set oText.DataBindings.Add(adoPrimaryRS)
            //        txtInteger_LostFocus oText.Index
            //    Next
            oText = _txtFloat_0;
            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_0.Item(0, New System.EventArgs()))
            //Next oText
            //    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();
        }
Ejemplo n.º 49
0
        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();
        }
Ejemplo n.º 50
0
        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;
        }
Ejemplo n.º 51
0
        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) {
                k_posNew = false;
                k_posID = id;
                //Get Warehouse ID...
                adoPrimaryRS = modRecordSet.getRS(ref "select * from Warehouse WHERE WarehouseID = " + id);
            } else {
                k_posNew = true;
                adoPrimaryRS = modRecordSet.getRS(ref "select * from Warehouse");
                adoPrimaryRS.AddNew();
                this.Text = this.Text + " [New record]";
                _txtInteger_0.Enabled = true;
                mbAddNewFlag = true;
            }

            setup();
            foreach (TextBox oText_loopVariable in this.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())
            }

            bolLoad = true;
            if (id) {

            }
            bolLoad = false;

            mbDataChanged = false;

            loadLanguage();
            ShowDialog();
        }
Ejemplo n.º 52
0
        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();
        }
Ejemplo n.º 53
0
        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();
        }
Ejemplo n.º 54
0
        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;
            }
        }
Ejemplo n.º 55
0
        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;
        }
Ejemplo n.º 56
0
        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;
        }
Ejemplo n.º 57
0
 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;
 }
Ejemplo n.º 58
0
 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();
         }
     }
 }
Ejemplo n.º 59
0
        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;
        }
Ejemplo n.º 60
0
        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";
        }