private void TxtEmpCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { HelpGridView.Columns.Clear(); HelpGrid.Text = "EmpCode"; if (txtEmpCode.Text.Length == 0) { var ds = ProjectFunctions.GetDataSet("SELECT empmst.EmpCode, empmst.EmpName, DeptMst.DeptDesc FROM empmst LEFT OUTER JOIN DeptMst ON empmst.EmpDeptCode = DeptMst.DeptCode "); HelpGrid.DataSource = ds.Tables[0]; HelpGridView.BestFitColumns(); HelpGrid.Show(); HelpGrid.Focus(); } else { var ds = ProjectFunctions.GetDataSet("SELECT empmst.EmpCode, empmst.EmpName, DeptMst.DeptDesc FROM empmst LEFT OUTER JOIN DeptMst ON empmst.EmpDeptCode = DeptMst.DeptCode Where EmpCode='" + txtEmpCode.Text.Trim() + "'"); if (ds.Tables[0].Rows.Count > 0) { txtEmpCode.Text = ds.Tables[0].Rows[0]["EmpCode"].ToString(); btnLoad_Data.Focus(); } else { var ds1 = ProjectFunctions.GetDataSet("SELECT empmst.EmpCode, empmst.EmpName, DeptMst.DeptDesc FROM empmst LEFT OUTER JOIN DeptMst ON empmst.EmpDeptCode = DeptMst.DeptCode"); HelpGrid.DataSource = ds1.Tables[0]; HelpGridView.BestFitColumns(); HelpGrid.Show(); HelpGrid.Focus(); } } } e.Handled = true; }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { try { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtGroupCode") { txtGroupCode.Text = row["AddressBookGroupCode"].ToString(); txtGroupDesc.Text = row["AddressBookGroupDesc"].ToString(); HelpGrid.Visible = false; txtTitle.Focus(); } if (HelpGrid.Text == "txtCityCode") { txtCityCode.Text = row["CTSYSID"].ToString(); txtCityName.Text = row["CTNAME"].ToString(); txtState.Text = row["STNAME"].ToString(); txtCountry.Text = row["UNDERRG"].ToString(); HelpGrid.Visible = false; txtCompany.Focus(); } } catch (Exception ex) { ProjectFunctions.SpeakError(ex.Message); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { var row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtProductACode") { txtProductACode.Text = row["PrdAsgnCode"].ToString(); txtProductCode.Text = row["PrdCode"].ToString(); txtProductName.Text = row["PrdName"].ToString(); HelpGrid.Visible = false; txtProductQty.Focus(); } if (HelpGrid.Text == "txtDebitPartyCode") { txtDebitPartyCode.Text = row["AccCode"].ToString(); txtDebitPartyName.Text = row["AccName"].ToString(); HelpGrid.Visible = false; txtVatInvoice.Focus(); } if (HelpGrid.Text == "txtVehicleCode") { txtVehicleCode.Text = row["VehicleCode"].ToString(); txtVehicleDesc.Text = row["VehicleRegNo"].ToString(); HelpGrid.Visible = false; } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { try { var row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtMenuName") { txtMenuName.Text = row["Description"].ToString(); HelpGrid.Visible = false; txtSMenuName.Focus(); } if (HelpGrid.Text == "txtSMenuName") { txtSMenuName.Text = row["Description"].ToString(); HelpGrid.Visible = false; txtNfaTag.Focus(); } if (HelpGrid.Text == "txtRoleCode") { txtRoleCode.Text = row["RoleCode"].ToString(); txtRoleDesc.Text = row["RoleDesc"].ToString(); HelpGrid.Visible = false; txtRoleCode.Focus(); } } catch (Exception ex) { ProjectFunctions.SpeakError(ex.Message); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtCategoryCode") { txtCategoryCode.Text = row["CatgCode"].ToString(); txtCategoryDesc.Text = row["CatgDesc"].ToString(); HelpGrid.Visible = false; txtDeptCode.Focus(); } if (HelpGrid.Text == "txtDeptCode") { txtDeptCode.Text = row["DeptCode"].ToString(); txtDeptDesc.Text = row["DeptDesc"].ToString(); HelpGrid.Visible = false; txtDesgCode.Focus(); } if (HelpGrid.Text == "txtDesgCode") { txtDesgCode.Text = row["DesgCode"].ToString(); txtDesgDesc.Text = row["DesgDesc"].ToString(); HelpGrid.Visible = false; txtUnitCode.Focus(); } if (HelpGrid.Text == "txtUnitCode") { txtUnitCode.Text = row["UnitCode"].ToString(); txtUnitDesc.Text = row["UnitName"].ToString(); HelpGrid.Visible = false; txtDOJ.Focus(); } }
private void TxtSGrpCode_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { HelpGridView.Columns.Clear(); HelpGrid.Text = "txtSGrpCode"; DataSet ds = ProjectFunctions.GetDataSet("Select GrpSubCode,GrpSubDesc,GrpCode,GrpDesc,GrpHSNCode from GrpMst"); if (ds.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } else { ProjectFunctions.SpeakError("No Records To Display"); } } e.Handled = true; } catch (Exception ex) { ProjectFunctions.SpeakError(ex.Message); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { var row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); switch (HelpGrid.Text) { case "Advance": Txt_AdvVoucherNo.Text = row["AdvVutNo"].ToString(); DtAdvanceVuDt.EditValue = Convert.ToDateTime(row["AdvVutDate"]); Txt_AdvVoucherType.Text = row["AdvVutType"].ToString(); Txt_AdvAmt.Text = row["AdvVutAmt"].ToString(); HelpGrid.Visible = false; BtnRefreshGridData.Focus(); break; case "Dealer": Txt_DealerCode.Text = row["DealerCode"].ToString(); Txt_Dealer.Text = row["DealerName"].ToString(); Txt_AdvVoucherNo.Text = string.Empty; Txt_AdvVoucherType.Text = string.Empty; Txt_AdvAmt.Text = string.Empty; Txt_AdvVoucherNo.Focus(); break; } HelpGrid.Visible = false; btnSave.Enabled = false; }
private void LoadLayoutForms() { DataTable dt = new DataTable(); dt.Columns.Add("ProgCode", typeof(string)); dt.Columns.Add("LayoutName", typeof(string)); string Address = string.Format(@"{0}\Layouts\{1}\", GlobalVariables.LayoutLocation, GlobalVariables.CurrentUser); string[] Dir = System.IO.Directory.GetDirectories(Address); foreach (string StrDir in Dir) { string[] DirFiles = System.IO.Directory.GetFiles(StrDir); foreach (string StrFiles in DirFiles) { DataRow dr = dt.NewRow(); dr["ProgCode"] = StrDir.Replace(Address, string.Empty); dr["LayoutName"] = StrFiles.Replace(StrDir, string.Empty).Replace(@"\", string.Empty); dt.Rows.Add(dr); } } if (dt.Rows.Count > 0) { HelpGrid.DataSource = dt; HelpGrid.Visible = true; HelpGridView.BestFitColumns(); HelpGrid.BringToFront(); HelpGrid.Focus(); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtAccCode") { txtAccCode.Text = row["AccCode"].ToString(); txtAccName.Text = row["AccName"].ToString(); HelpGrid.Visible = false; txtAccCode.Focus(); } if (HelpGrid.Text == "Load") { DataSet ds = ProjectFunctions.GetDataSet("sp_LoadEANData '" + row[0].ToString() + "'"); if (ds.Tables[0].Rows.Count > 0) { AddRowsToDatatable(); dt = ds.Tables[0]; InfoGrid.DataSource = dt; InfoGridView.BestFitColumns(); HelpGrid.Visible = false; } else { InfoGrid.DataSource = null; } } }
private void BtnSave_Click(object sender, EventArgs e) { HelpGridView.CloseEditor(); HelpGridView.UpdateCurrentRow(); #pragma warning disable CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.' var MaxRow = ((HelpGrid.KeyboardFocusView as GridView).RowCount); #pragma warning restore CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.' for (int i = 0; i < MaxRow; i++) { DataRow CurrentRow = HelpGridView.GetDataRow(i); if (CurrentRow["PassUnPass"].ToString().ToUpper() == "TRUE") { string Query = "update IndData Set "; Query = Query + " IndPassTag='Y',IndPassDt='" + DateTime.Now.ToString("yyyy-MM-dd") + "',IndDItemQtyPass='******' Where IndID='" + CurrentRow["IndID"] + "'"; ProjectFunctions.GetDataSet(Query); } else { DataSet dsCheck = ProjectFunctions.GetDataSet("Select * from POData Where POIndId='" + CurrentRow["IndID"] + "'"); if (dsCheck.Tables[0].Rows.Count > 0) { ProjectFunctions.SpeakError("Purchase Order Has Already Been Generated Against This Indent"); } else { string Query = "update IndData Set IndDItemQtyPass=0,"; Query = Query + " IndPassTag=null,IndPassDt=null Where IndID='" + CurrentRow["IndID"] + "'"; ProjectFunctions.GetDataSet(Query); } } } Close(); }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtCGSTPostingCode") { txtCGSTPostingCode.Text = row["AccCode"].ToString(); txtCGSTPostingDesc.Text = row["AccName"].ToString(); HelpGrid.Visible = false; txtSGSTPostingCode.Focus(); } if (HelpGrid.Text == "txtSGSTPostingCode") { txtSGSTPostingCode.Text = row["AccCode"].ToString(); txtSGSTPostingDesc.Text = row["AccName"].ToString(); HelpGrid.Visible = false; txtIGSTPostingCode.Focus(); } if (HelpGrid.Text == "txtIGSTPostingCode") { txtIGSTPostingCode.Text = row["AccCode"].ToString(); txtIGSTPostingDesc.Text = row["AccName"].ToString(); HelpGrid.Visible = false; txtMessage.Focus(); } if (HelpGrid.Text == "txtSalePostCode") { txtSalePostCode.Text = row["AccCode"].ToString(); txtSalePostDesc.Text = row["AccName"].ToString(); HelpGrid.Visible = false; txtSalePostCode.Focus(); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow currentrow = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "SKU") { DataSet ds = ProjectFunctions.GetDataSet("sp_LoadSKUForPI '" + currentrow["SKUVOUCHNO"].ToString() + "' ,'" + currentrow["SKUFNYR"].ToString() + "'"); if (ds.Tables[0].Rows.Count > 0) { dt = ds.Tables[0]; InfoGrid.DataSource = ds.Tables[0]; InfoGridView.BestFitColumns(); HelpGrid.Visible = false; } else { InfoGrid.DataSource = null; InfoGridView.BestFitColumns(); } } if (HelpGrid.Text == "STORE") { txtStoreCode.Text = currentrow["AccDCCode"].ToString(); HelpGrid.Visible = false; } }
private void FrmIndentPassing_Load(object sender, EventArgs e) { SetMyControls(); DataSet ds = ProjectFunctions.GetDataSet("sp_LoadIndDataFPassing '" + IndentNo + "','" + IndentDate.Date.ToString("yyyy-MM-dd") + "'"); if (ds.Tables[0].Rows.Count > 0) { ds.Tables[0].Columns.Add("PassUnPass", typeof(bool)); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["IndPassTag"].ToString().ToUpper() == "Y") { dr["PassUnPass"] = true; } else { dr["PassUnPass"] = false; } } HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } }
private void TxtSearchBox_KeyDown(object sender, KeyEventArgs e) { try { HelpGridView.CloseEditor(); HelpGridView.UpdateCurrentRow(); if (e.KeyCode == Keys.Enter) { HelpGrid_DoubleClick(null, e); } if (e.KeyCode == Keys.Down) { HelpGrid.Focus(); } if (e.KeyCode == Keys.Escape) { panelControl2.Visible = false; } e.Handled = true; } catch (Exception ex) { ProjectFunctions.SpeakError(ex.Message); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { var row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtPCode") { txtPCode.Text = row["AccCode"].ToString().Trim(); txtPDesc.Text = row["AccName"].ToString().Trim(); HelpGrid.Visible = false; txtTDSCode.Focus(); } if (HelpGrid.Text == "txtPCode") { txtTDSCode.Text = row["TdsCode"].ToString(); txtTDSDesc.Text = row["TdsDesc"].ToString(); txtTDSRate.Text = row["TdsRate"].ToString().Trim(); txtTDSSurcharge.Text = row["TdsSRate"].ToString(); txtUnderSection.Text = row["TdsUS"].ToString(); if (txtTDSRate.Text == "0") { txtTDSAmount.Enabled = true; txtSurcOnTDS.Enabled = true; } else { txtTDSAmount.Enabled = false; txtSurcOnTDS.Enabled = false; } HelpGrid.Visible = false; txtOnAmount.Focus(); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow Row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); txtProductACode.Text = Row["PrdAsgnCode"].ToString(); txtProductName.Text = Row["PrdName"].ToString(); txtProductCode.Text = Row["PrdCode"].ToString(); HelpGrid.Visible = false; txtQty.Focus(); }
private void txtProductACode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { HelpGrid.Text = "txtProductACode"; if (txtProductACode.Text.Trim().Length == 0) { DataSet ds = ProjectFunctions.GetDataSet("SELECT InvoiceData.IdPrdCode, PrdMst.PrdAsgnCode, PrdMst.PrdName, InvoiceData.IdPrdRate, InvoiceData.IdDiscRate,InvoiceData.IdSchmQty,InvoiceData.IdSchmQtyF FROM InvoiceData INNER JOIN PrdMst ON InvoiceData.IdPrdCode = PrdMst.PrdCode Where IdType='S' And IdDate='" + Convert.ToDateTime(txtAgainstInvDate.Text).ToString("yyyy-MM-dd") + "' And IdNo='" + txtAgainstInvNo.Text.Trim() + "'"); if (ds.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } else { ProjectFunctions.SpeakError("No Record To Display"); txtProductACode.Focus(); } } else { DataSet ds = ProjectFunctions.GetDataSet("SELECT InvoiceData.IdPrdCode, PrdMst.PrdAsgnCode, PrdMst.PrdName, InvoiceData.IdPrdRate, InvoiceData.IdDiscRate,InvoiceData.IdSchmQty,InvoiceData.IdSchmQtyF FROM InvoiceData INNER JOIN PrdMst ON InvoiceData.IdPrdCode = PrdMst.PrdCode Where IdType='S' And IdDate='" + Convert.ToDateTime(txtAgainstInvDate.Text).ToString("yyyy-MM-dd") + "' And IdNo='" + txtAgainstInvNo.Text.Trim() + "' And PrdAsgnCode='" + txtProductACode.Text.Trim() + "'"); if (ds.Tables[0].Rows.Count > 0) { txtProductACode.Text = ds.Tables[0].Rows[0]["PrdAsgnCode"].ToString(); txtProductCode.Text = ds.Tables[0].Rows[0]["IdPrdCode"].ToString(); txtProductName.Text = ds.Tables[0].Rows[0]["PrdName"].ToString(); txtProductRate.Text = ds.Tables[0].Rows[0]["IdPrdRate"].ToString(); txtRdc.Text = ds.Tables[0].Rows[0]["IdDiscRate"].ToString(); txtSchmQty.Text = ds.Tables[0].Rows[0]["IdSchmQty"].ToString(); txtSchmQtyF.Text = ds.Tables[0].Rows[0]["IdSchmQtyF"].ToString(); txtProductQty.Focus(); } else { DataSet ds1 = ProjectFunctions.GetDataSet("SELECT InvoiceData.IdPrdCode, PrdMst.PrdAsgnCode, PrdMst.PrdName, InvoiceData.IdPrdRate, InvoiceData.IdDiscRate,InvoiceData.IdSchmQty,InvoiceData.IdSchmQtyF FROM InvoiceData INNER JOIN PrdMst ON InvoiceData.IdPrdCode = PrdMst.PrdCode Where IdType='S' And IdDate='" + Convert.ToDateTime(txtAgainstInvDate.Text).ToString("yyyy-MM-dd") + "' And IdNo='" + txtAgainstInvNo.Text.Trim() + "'"); if (ds1.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds1.Tables[0]; HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } else { ProjectFunctions.SpeakError("No Record To Display"); txtProductACode.Focus(); } } } } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { HelpGridView.CloseEditor(); HelpGridView.UpdateCurrentRow(); DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtVoucherTypeCode") { txtVoucherTypeCode.Text = row["VouCode"].ToString(); txtVoucherTypeDesc.Text = row["VouDesc"].ToString(); HelpGrid.Visible = false; panelControl2.Visible = false; txtAccountCode.Focus(); } if (HelpGrid.Text == "txtAccountCode") { txtAccountCode.Text = row["AccCode"].ToString(); txtAccountName.Text = row["AccName"].ToString(); HelpGrid.Visible = false; panelControl2.Visible = false; txtShortNarration.Focus(); } if (HelpGrid.Text == "AccCode") { if (HelpGridView.RowCount > 0) { DataRow dtNewRow = dt.NewRow(); dtNewRow["AccCode"] = row["AccCode"].ToString(); dtNewRow["AccName"] = row["AccName"].ToString(); dtNewRow["Amount"] = Convert.ToDecimal("0.00"); dtNewRow["Narration"] = string.Empty; dtNewRow["CRDR"] = SetCrDrValue(); dt.Rows.Add(dtNewRow); if (dt.Rows.Count > 0) { VoucherGrid.DataSource = dt; VoucherGridView.BestFitColumns(); } else { VoucherGrid.DataSource = null; VoucherGridView.BestFitColumns(); } panelControl2.Visible = false; VoucherGridView.Focus(); VoucherGridView.MoveLast(); VoucherGridView.FocusedColumn = VoucherGridView.Columns["Amount"]; VoucherGridView.ShowEditor(); txtSearchBox.Text = string.Empty; } } }
private void TxtProductACode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { HelpGridView.Columns.Clear(); HelpGrid.Text = "txtProductACode"; if (txtProductACode.Text.Trim().Length == 0) { DataSet ds = ProjectFunctions.GetDataSet("SELECT PrdMst.PrdCode,PrdMst.PrdAsgnCode, PrdMst.PrdName From PrdMst Where PrdActive='Y'"); if (ds.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Show(); HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } else { ProjectFunctions.SpeakError("No Records To Display"); } } else { DataSet ds = ProjectFunctions.GetDataSet("SELECT PrdMst.PrdCode,PrdMst.PrdAsgnCode, PrdMst.PrdName From PrdMst Where PrdActive='Y' And PrdAsgnCode='" + txtProductACode.Text + "'"); if (ds.Tables[0].Rows.Count > 0) { txtProductACode.Text = ds.Tables[0].Rows[0]["PrdAsgnCode"].ToString(); txtProductName.Text = ds.Tables[0].Rows[0]["PrdName"].ToString(); txtProductCode.Text = ds.Tables[0].Rows[0]["PrdCode"].ToString(); txtProductQty.Focus(); } else { DataSet ds1 = ProjectFunctions.GetDataSet("SELECT PrdMst.PrdCode,PrdMst.PrdAsgnCode, PrdMst.PrdName From PrdMst Where PrdActive='Y'"); if (ds1.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Show(); HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } else { ProjectFunctions.SpeakError("No Records To Display"); } } } } e.Handled = true; }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { var row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "EmpCode") { txtEmpCode.Text = row["EmpCode"].ToString(); HelpGrid.Visible = false; btnLoad_Data.Focus(); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtDebitPartyCode") { txtDebitPartyCode.Text = row["AccCode"].ToString(); txtDebitPartyName.Text = row["AccName"].ToString(); HelpGrid.Visible = false; txtDebitPartyCode.Focus(); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtContractorCode") { txtContractorCode.Text = row["CNTSYSID"].ToString(); txtContractorDesc.Text = row["CNTNAME"].ToString(); HelpGrid.Visible = false; txtWorkerName.Focus(); } }
private void TxtTDSCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { HelpGrid.Text = "txtTDSCode"; if (txtTDSCode.Text.Trim().Length == 0) { DataSet ds = ProjectFunctions.GetDataSet("select TdsCode,TdsDesc,TdsRate,TdsSRate,TdsUS from TdsMst "); if (ds.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Show(); HelpGrid.Focus(); HelpGridView.BestFitColumns(); } } else { DataSet ds = ProjectFunctions.GetDataSet("select TdsCode,TdsDesc,TdsRate,TdsSRate,TdsUS from TdsMst Where TdsCode='" + txtTDSCode.Text.Trim() + "'"); if (ds.Tables[0].Rows.Count > 0) { txtTDSCode.Text = ds.Tables[0].Rows[0]["TdsCode"].ToString(); txtTDSDesc.Text = ds.Tables[0].Rows[0]["TdsDesc"].ToString(); txtTDSRate.Text = ds.Tables[0].Rows[0]["TdsRate"].ToString().Trim(); txtTDSSurcharge.Text = ds.Tables[0].Rows[0]["TdsSRate"].ToString(); txtUnderSection.Text = ds.Tables[0].Rows[0]["TdsUS"].ToString(); if (txtTDSRate.Text == "0") { txtTDSAmount.Enabled = true; txtSurcOnTDS.Enabled = true; } else { txtTDSAmount.Enabled = false; txtSurcOnTDS.Enabled = false; } txtOnAmount.Focus(); } else { DataSet ds1 = ProjectFunctions.GetDataSet("select TdsCode,TdsDesc,TdsRate,TdsSRate,TdsUS from TdsMst "); if (ds1.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds1.Tables[0]; HelpGrid.Show(); HelpGrid.Focus(); HelpGridView.BestFitColumns(); } } } } }
private void TxtDebitPartyCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { PrepareActMstHelpGrid(); HelpGrid.Text = "txtDebitPartyCode"; if (txtDebitPartyCode.Text.Trim().Length == 0) { DataSet ds = ProjectFunctions.GetDataSet("sp_LoadActMstHelp"); if (ds.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Show(); HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } else { ProjectFunctions.SpeakError("No Records To Display"); } } else { DataSet ds = ProjectFunctions.GetDataSet(" sp_LoadActMstHelpWithCode '" + txtDebitPartyCode.Text.Trim() + "'"); if (ds.Tables[0].Rows.Count > 0) { txtDebitPartyCode.Text = ds.Tables[0].Rows[0]["AccCode"].ToString(); txtDebitPartyName.Text = ds.Tables[0].Rows[0]["AccName"].ToString(); txtDocType.Focus(); } else { DataSet ds1 = ProjectFunctions.GetDataSet("sp_LoadActMstHelp"); if (ds1.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Show(); HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } else { ProjectFunctions.SpeakError("No Records To Display"); } } } } e.Handled = true; }
private void TxtEmpCode_KeyDown(object sender, KeyEventArgs e) { try { PrepareEmpGrid(); var strQry = string.Empty; HelpGrid.Text = "txtEmpCode"; var ds = new DataSet(); if (e.KeyCode == Keys.Enter) { if (txtEmpCode.Text.Length == 0) { strQry = strQry + "select Empcode as Code,Empname as Description,EmpImage from EmpMst order by Empname"; ds = ProjectFunctions.GetDataSet(strQry); HelpGrid.DataSource = ds.Tables[0]; HelpGridView.BestFitColumns(); HelpGrid.Show(); HelpGrid.Focus(); } else { strQry = strQry + "select empcode as Code,empname as Description,EmpImage from EmpMst wHERE empcode= '" + txtEmpCode.Text.ToString().Trim() + "' "; ds = ProjectFunctions.GetDataSet(strQry); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; txtEmpCode.Text = dr["Code"].ToString().Trim().ToUpper(); txtEmpCodeDesc.Text = dr["Description"].ToString().Trim().ToUpper(); pictureBox1.Image = ImageUtils.ConvertBinaryToImage((byte[])dr["EmpImage"]); txtStatusCode.Focus(); } else { var strQry1 = string.Empty; strQry1 = strQry1 + "select empcode as Code,empname as Description,EmpImage from EmpMst order by Empname"; var ds1 = ProjectFunctions.GetDataSet(strQry1); HelpGrid.DataSource = ds1.Tables[0]; HelpGridView.BestFitColumns(); HelpGrid.Show(); HelpGrid.Focus(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } e.Handled = true; }
private void HelpGridView_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Select All Records", (o1, e1) => { #pragma warning disable CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.' var MaxRow = ((HelpGrid.KeyboardFocusView as GridView).RowCount); #pragma warning restore CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.' for (var i = 0; i < MaxRow; i++) { HelpGridView.SetRowCellValue(i, HelpGridView.Columns["Select"], true); } })); }
private void frmRateFeeding_Load(object sender, EventArgs e) { SetMyControls(); DataSet ds = ProjectFunctions.GetDataSet("sp_LoadRates '" + DealerCode + "'"); if (ds.Tables[0].Rows.Count > 0) { HelpGrid.DataSource = ds.Tables[0]; HelpGrid.Visible = true; HelpGrid.Focus(); HelpGridView.BestFitColumns(); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtARTID") { txtARTID.Text = row["ARTSYSID"].ToString(); txtArtNo.Text = row["ARTNO"].ToString(); txtArtDesc.Text = row["GrpSubDesc"].ToString(); HelpGrid.Visible = false; txtARTID.Focus(); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { try { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtTaxCodeL") { txtTaxCodeL.Text = row["TaxCode"].ToString(); txtTaxCodeLDesc.Text = row["TaxDesc"].ToString(); HelpGrid.Visible = false; txtTaxCodeC.Focus(); } if (HelpGrid.Text == "txtTaxCodeC") { txtTaxCodeC.Text = row["TaxCode"].ToString(); txtTaxCodeCDesc.Text = row["TaxDesc"].ToString(); HelpGrid.Visible = false; txtTaxCodeC.Focus(); } if (HelpGrid.Text == "txtUMCode") { txtUMCode.Text = row["UomCode"].ToString(); txtUMDesc.Text = row["UomDesc"].ToString(); HelpGrid.Visible = false; txtMRP.Focus(); } if (HelpGrid.Text == "txtBrandCode") { txtBrandCode.Text = row["BRSYSID"].ToString(); txtBrandDesc.Text = row["BRNAME"].ToString(); HelpGrid.Visible = false; txtUMCode.Focus(); } if (HelpGrid.Text == "txtSGrpCode") { txtSGrpCode.Text = row["GrpSubCode"].ToString(); txtSGrpDesc.Text = row["GrpSubDesc"].ToString(); txtGrpCode.Text = row["GrpCode"].ToString(); txtGrpDesc.Text = row["GrpDesc"].ToString(); txtHSNCode.Text = row["GrpHSNCode"].ToString(); HelpGrid.Visible = false; txtArtNo.Focus(); } } catch (Exception ex) { ProjectFunctions.SpeakError(ex.Message); } }
private void HelpGrid_DoubleClick(object sender, EventArgs e) { DataRow row = HelpGridView.GetDataRow(HelpGridView.FocusedRowHandle); if (HelpGrid.Text == "txtCityCode") { txtCityCode.Text = row["CTSYSID"].ToString(); txtCityName.Text = row["CTNAME"].ToString(); txtState.Text = row["STNAME"].ToString(); txtCountry.Text = row["UNDERRG"].ToString(); HelpGrid.Visible = false; txtContactPerson.Focus(); } }