private void btnStockItem_Click(object sender, EventArgs e) { if (Utility.gblnAccessControl) { if (!Utility.gblnChildPrivileges(strComID, Utility.gstrUserName, 61)) { MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } if (System.Windows.Forms.Application.OpenForms["frmStockItem"] as frmStockItem == null) { frmStockItem objfrm = new frmStockItem(); objfrm.m_action = (int)Utility.ACTION_MODE_ENUM.ADD_MODE; objfrm.lngFormPriv = 61; objfrm.strFormName = "Stock Item"; objfrm.Show(); objfrm.MdiParent = this.MdiParent; } else { frmStockItem objfrm = (frmStockItem)Application.OpenForms["frmStockItem"]; objfrm.strFormName = "Stock Item"; objfrm.lngFormPriv = 61; objfrm.Focus(); objfrm.MdiParent = this.MdiParent; } }
private void uctxtItemName_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up) { DG.Focus(); } if (e.KeyCode == Keys.Down) { DG.Focus(); } if (e.KeyCode == Keys.Return) { int i = Convert.ToInt16(DG.CurrentRow.Index); uctxtItemName.Text = DG.Rows[i].Cells[0].Value.ToString(); if (onAddAllButtonClicked != null) { onAddAllButtonClicked(GetSelectedItem(i), sender, e); } this.Dispose(); } if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control) { frmStockItem objfrm = new frmStockItem(); objfrm.m_action = (int)Utility.ACTION_MODE_ENUM.ADD_MODE; objfrm.mSingleEntry = 1; objfrm.Show(); objfrm.MdiParent = this.MdiParent; } }
private void DataList1_DblClick(System.Object eventSender, System.EventArgs eventArgs) { // ERROR: Not supported in C#: OnErrorStatement if (string.IsNullOrEmpty(DataList1.BoundText)) { return; } int lID = 0; lID = Convert.ToInt32(DataList1.BoundText); switch (gSection) { case -1: gID = Convert.ToInt32(DataList1.BoundText); this.Close(); break; case 0: My.MyProject.Forms.frmStockItem.loadItem(ref Convert.ToInt32(DataList1.BoundText)); //* Hiding frmstocklist // frmStockList.Hide //* frmStockItem formIten = null; formIten.Show(); break; case 1: My.MyProject.Forms.frmStockPricing.loadItem(ref Convert.ToInt32(DataList1.BoundText)); //* Hiding Stocklist // frmStockList.Hide //* frmStockPricing formPrice = null; formPrice.Show(); break; } if (modApplication.blNextItem == true) { gRS.Requery(); //UPGRADE_NOTE: Refresh was upgraded to CtlRefresh. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"' DataList1.CtlRefresh(); modApplication.blNextItem = false; } }
private void cmdEdit_Click(System.Object eventSender, System.EventArgs eventArgs) { //* Disable the Pricing Set button when frmpricesetlist is open My.MyProject.Forms.frmStockItem.cmdpriceselist.Enabled = false; //*Code that refuses you access to frmstockitem before you add the new primary stockitem if (string.IsNullOrEmpty(this.lblStockItem.Tag)) { Interaction.MsgBox("Please Select the Primary Stock Item", MsgBoxStyle.Information); return; } //* if (Convert.ToBoolean(this.lblStockItem.Tag)) { My.MyProject.Forms.frmStockItem.loadItem(ref Convert.ToInt32(this.lblStockItem.Tag)); frmStockItem form = null; form.Show(); } }
private void doSearchBC() { ADODB.Recordset rj = default(ADODB.Recordset); string sql = null; string lString = null; // ERROR: Not supported in C#: OnErrorStatement lString = Strings.Trim(txtBCode.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, " ", " "); int lID = 0; if (string.IsNullOrEmpty(Strings.Trim(lString))) { } else { txtBCode.SelectionStart = 0; txtBCode.SelectionLength = 999; rj = modRecordSet.getRS(ref "SELECT Catalogue.Catalogue_StockItemID, Catalogue.Catalogue_Barcode, StockItem.StockItemID, StockItem.StockItem_Name FROM Catalogue INNER JOIN StockItem ON Catalogue.Catalogue_StockItemID = StockItem.StockItemID WHERE (((Catalogue.Catalogue_Barcode)='" + lString + "') AND ((Catalogue.Catalogue_Disabled)=False));"); if (rj.RecordCount > 0) { txtSearch.Text = rj.Fields("StockItem_Name").Value; //doSearch //If DataList1.BoundText = "" Then Exit Sub lID = rj.Fields("Catalogue_StockItemID").Value; //DataList1.BoundText switch (gSection) { case -1: gID = rj.Fields("Catalogue_StockItemID").Value; //DataList1.BoundText this.Close(); break; case 0: My.MyProject.Forms.frmStockItem.loadItem(ref rj.Fields("Catalogue_StockItemID").Value); //DataList1.BoundText //* Hiding frmstocklist this.Hide(); //* frmStockItem formItem = null; formItem.Show(); break; case 1: My.MyProject.Forms.frmStockPricing.loadItem(ref rj.Fields("Catalogue_StockItemID").Value); // DataList1.BoundText //* Hiding Stocklist this.Hide(); //* frmStockPricing formPrice = null; formPrice.Show(); break; } //gRS.Requery //DataList1.Refresh } } }