private void BtnEdit_Click(object sender, System.EventArgs e) { try { if (ViewGrid.CurrentRowIndex >= 0) { ControlVisible(true); ClearControls(); chkCancelled.Visible = true; // A particular id wise retriving the data from database if (ShowRecord(Convert.ToInt64(ViewGrid[ViewGrid.CurrentRowIndex, 0].ToString())) == false) { ControlVisible(false); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "INVOICE_HEADER_ID", lngSearchId); cmbCompany.Enabled = true; } lblMode.Text = J_Mode.Edit; cmnService.J_StatusButton(this, lblMode.Text); lblSearchMode.Text = J_Mode.General; cmbCompany.Enabled = false; strCheckFields = ""; } else { cmnService.J_UserMessage("No record selected"); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "INVOICE_HEADER_ID", lngSearchId); } } catch (Exception err_handler) { ControlVisible(false); cmnService.J_UserMessage(err_handler.Message); } }
private void BtnRefresh_Click(object sender, EventArgs e) { lblMode.Text = J_Mode.ViewListing; cmnService.J_StatusButton(this, lblMode.Text); BtnEdit.Enabled = false; BtnEdit.BackColor = Color.LightGray; BtnDelete.BackColor = Color.LightGray; BtnDelete.Enabled = false; lblSearchMode.Text = J_Mode.General; strSQL = strQuery + "order by " + strOrderBy; //--------------------------------------------------------- if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref this.ViewGrid, strSQL, strMatrix); if (dsetGridClone == null) { return; } //--------------------------------------------------------- dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "FAYEAR_ID", lngSearchId); }
private void BtnEdit_Click(object sender, System.EventArgs e) { try { if (ViewGrid.CurrentRowIndex >= 0) { ControlVisible(true); ClearControls(); // A particular id wise retrieving the data from database if (ShowRecord(Convert.ToInt64(Convert.ToString(ViewGrid[ViewGrid.CurrentRowIndex, 0]))) == false) { ControlVisible(false); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "PARTY_ID", lngSearchId); } lblMode.Text = J_Mode.Edit; cmnService.J_StatusButton(this, lblMode.Text); lblSearchMode.Text = J_Mode.General; strCheckFields = ""; } else { cmnService.J_UserMessage(J_Msg.DataNotFound); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "PARTY_ID", lngSearchId); } } catch (Exception err_handler) { ControlVisible(false); cmnService.J_UserMessage(err_handler.Message); } }
private void BtnEdit_Click(object sender, System.EventArgs e) { try { if (ViewGrid.CurrentRowIndex >= 0) { ControlVisible(true); ClearControls(); //=============== EDIT RESTRICTION ================== // RESTRICT RECORD MODIFICATION WHEN START NO & LAST NO NOT MATCH if (dmlService.J_IsRecordExist("MST_INVOICE_SERIES", " START_NO <> LAST_NO " + "AND INVOICE_SERIES_ID = " + lngSearchId + "") == true) { cmnService.J_UserMessage("Modification not possible"); dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "INVOICE_SERIES_ID", lngSearchId); return; } // RESTRICT RECORD MODIFICATION WHEN IF TRANSACTION IS OVER if (dmlService.J_IsRecordExist("TRN_INVOICE_HEADER", " INVOICE_SERIES_ID = " + lngSearchId + "") == true) { cmnService.J_UserMessage("Modification not possible"); dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "INVOICE_SERIES_ID", lngSearchId); return; } // A particular id wise retrieving the data from database if (ShowRecord(Convert.ToInt64(Convert.ToString(ViewGrid[ViewGrid.CurrentRowIndex, 0]))) == false) { ControlVisible(false); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "INVOICE_SERIES_ID", lngSearchId); } lblMode.Text = J_Mode.Edit; cmnService.J_StatusButton(this, lblMode.Text); lblSearchMode.Text = J_Mode.General; strCheckFields = ""; } else { cmnService.J_UserMessage(J_Msg.DataNotFound); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "INVOICE_SERIES_ID", lngSearchId); } } catch (Exception err_handler) { ControlVisible(false); cmnService.J_UserMessage(err_handler.Message); } }
private void BtnEdit_Click(object sender, System.EventArgs e) { try { if (ViewGrid.CurrentRowIndex >= 0) { ControlVisible(true); ClearControls(); grpPassword.Visible = false; txtLoginId.ReadOnly = true; txtLoginId.BackColor = Color.LightYellow; chkResetPassword.Visible = true; chkResetPassword.Checked = false; chkResetPassword.Location = new Point(428, 235); // A particular id wise retriving the data from database if (ShowRecord(Convert.ToInt64(ViewGrid[ViewGrid.CurrentRowIndex, 0].ToString())) == false) { ControlVisible(false); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "USER_ID", lngSearchId); } txtUserName.Enabled = true; lblMode.Text = J_Mode.Edit; cmnService.J_StatusButton(this, lblMode.Text); lblSearchMode.Text = J_Mode.General; strCheckFields = ""; } else { cmnService.J_UserMessage(J_Msg.DataNotFound); if (dsetGridClone == null) { return; } dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "USER_ID", lngSearchId); } } catch (Exception err_handler) { ControlVisible(false); cmnService.J_UserMessage(err_handler.Message); } }