private void BtnOK_Click(object sender, EventArgs e) { if (ValidateFields() == false) { return; } if (MessageBox.Show(this, "Are you sure to change your Password ?", J_Var.J_pProjectName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dmlService.J_BeginTransaction(); strSQL = "UPDATE MST_USER " + "SET USER_PASSWORD = '******'" + "WHERE BRANCH_ID = " + J_Var.J_pBranchId + " " + "AND USER_ID = " + J_Var.J_pUserId + ""; if (dmlService.J_ExecSql(strSQL) == false) { dmlService.J_Rollback(); return; } dmlService.J_Commit(); cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, "Password Updated to :: ******* "); dmlService.Dispose(); Application.Restart(); } }
private void Insert_Update_Delete_Data() { try { int intSaveConfirmationMessage = 0; string strLast_Reconciliation_Date = ""; // Save Confirmation Message if (chkSaveConfirmationMessage.Checked == true) { intSaveConfirmationMessage = 1; } else if (chkSaveConfirmationMessage.Checked == false) { intSaveConfirmationMessage = 0; } if (dtService.J_IsBlankDateCheck(ref mskLastReconcileDate, J_ShowMessage.NO) == false) { strLast_Reconciliation_Date = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskLastReconcileDate) + cmnService.J_DateOperator(); } else { strLast_Reconciliation_Date = "null"; } switch (lblMode.Text) { case J_Mode.Add: if (ValidateFields() == false) { return; } // save confirmation message if (cmnService.J_SaveConfirmationMessage(ref txtAddress) == true) { return; } // begin transaction dmlService.J_BeginTransaction(); strSQL = "UPDATE MST_SETUP " + " SET ADDRESS = '" + cmnService.J_ReplaceQuote(txtAddress.Text.Trim()) + "'," + " CITY = '" + cmnService.J_ReplaceQuote(txtCity.Text.Trim()) + "'," + " PIN = '" + cmnService.J_ReplaceQuote(txtPin.Text.Trim()) + "'," + " CONTACT_NO = '" + cmnService.J_ReplaceQuote(txtContactNo.Text.Trim()) + "'," + " EMAIL_ID = '" + cmnService.J_ReplaceQuote(txtEmailId.Text.Trim()) + "'," + " WEB_SITE = '" + cmnService.J_ReplaceQuote(txtWebsite.Text.Trim()) + "'," + " OPENING_SUNDRY_OUTSTANDING = " + cmnService.J_ReplaceQuote(txtSundryOpening.Text.Trim()) + "," + " SUNDRY_CUTOFF_DATE = " + cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskSundryCutoffDate) + cmnService.J_DateOperator() + "," + " SAVE_CONFIRMATION_MSG = " + intSaveConfirmationMessage + "," + " NETWORK_CREDENTIAL_USERNAME = '******'," + " NETWORK_CREDENTIAL_PASSWORD = '******'," + " NETWORK_CREDENTIAL_PORT = '" + cmnService.J_ReplaceQuote(txtNetPort.Text.Trim()) + "'," + " NETWORK_CREDENTIAL_HOST = '" + cmnService.J_ReplaceQuote(txtNetHost.Text.Trim()) + "', " + " SMS_WORKING_KEY = '" + cmnService.J_ReplaceQuote(txtSmsWorkingKey.Text.Trim()) + "', " + " SMS_OFFLINE_INVOICE_MESSAGE = '" + cmnService.J_ReplaceQuote(txtOfflineSmsMessage.Text.Trim()) + "', " + " SMS_ONLINE_INVOICE_MESSAGE = '" + cmnService.J_ReplaceQuote(txtOnlineSmsMessage.Text.Trim()) + "', " + " SMS_SENDER_NAME = '" + cmnService.J_ReplaceQuote(txtSmsSenderName.Text.Trim()) + "', " + " LAST_RECONCILIATION_DATE = " + strLast_Reconciliation_Date + "" + " WHERE BRANCH_ID = " + J_Var.J_pBranchId + " "; if (dmlService.J_ExecSql(strSQL) == false) { return; } J_Var.J_pBranchAddress = txtAddress.Text.Trim(); J_Var.J_pSaveConfirmMsg = intSaveConfirmationMessage; // Transaction is commited dmlService.J_Commit(); cmnService.J_PanelMessage(0, "Setup Updated"); this.dmlService.Dispose(); this.Close(); this.Dispose(); break; case J_Mode.Edit: break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { switch (lblMode.Text) { case J_Mode.Add: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtPartyName) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // insert query & execution strSQL = "INSERT INTO MST_PARTY (" + " BRANCH_ID," + " PARTY_CATEGORY_ID," + " PARTY_NAME," + " ADDRESS1," + " ADDRESS2," + " ADDRESS3," + " CITY," + " PIN," + " CONTACT_PERSON," + " MOBILE_NO," + " PHONE_NO," + " FAX," + " EMAIL_ID," + " VAT_NO," + " USER_ID," + " CREATE_DATE) " + " VALUES( " + J_Var.J_pBranchId + "," + " " + Support.GetItemData(cmbPartyCategory, cmbPartyCategory.SelectedIndex) + "," + " '" + cmnService.J_ReplaceQuote(txtPartyName.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtAddress1.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtAddress2.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtAddress3.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtCity.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtPin.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtContactPersonName.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtMobileNo.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtPhone.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtFaxNo.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtEmailID.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtVatNo.Text.Trim()) + "'," + " " + J_Var.J_pUserId + "," + " " + cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(dmlService.J_ReturnServerDate()) + cmnService.J_DateOperator() + ")"; if (dmlService.J_ExecSql(strSQL) == false) { txtPartyName.Select(); return; } // get last inserted area id as per branch & user lngSearchId = dmlService.J_ReturnMaxValue("MST_PARTY", "PARTY_ID", " BRANCH_ID = " + J_Var.J_pBranchId + " " + "AND USER_ID = " + J_Var.J_pUserId + ""); if (lngSearchId == 0) { return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.AddModeSave); // all controls are cleared ClearControls(); txtPartyName.Select(); break; case J_Mode.Edit: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtPartyName) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // update query & execution strSQL = "UPDATE MST_PARTY " + "SET PARTY_CATEGORY_ID = " + Support.GetItemData(cmbPartyCategory, cmbPartyCategory.SelectedIndex) + ", " + " PARTY_NAME = '" + cmnService.J_ReplaceQuote(txtPartyName.Text.Trim()) + "'," + " ADDRESS1 = '" + cmnService.J_ReplaceQuote(txtAddress1.Text.Trim()) + "'," + " ADDRESS2 = '" + cmnService.J_ReplaceQuote(txtAddress2.Text.Trim()) + "'," + " ADDRESS3 = '" + cmnService.J_ReplaceQuote(txtAddress3.Text.Trim()) + "'," + " CITY = '" + cmnService.J_ReplaceQuote(txtCity.Text.Trim()) + "'," + " PIN = '" + cmnService.J_ReplaceQuote(txtPin.Text.Trim()) + "'," + " CONTACT_PERSON = '" + cmnService.J_ReplaceQuote(txtContactPersonName.Text.Trim()) + "'," + " MOBILE_NO = '" + cmnService.J_ReplaceQuote(txtMobileNo.Text.Trim()) + "'," + " PHONE_NO = '" + cmnService.J_ReplaceQuote(txtPhone.Text.Trim()) + "'," + " FAX = '" + cmnService.J_ReplaceQuote(txtFaxNo.Text.Trim()) + "'," + " EMAIL_ID = '" + cmnService.J_ReplaceQuote(txtEmailID.Text.Trim()) + "'," + " VAT_NO = '" + cmnService.J_ReplaceQuote(txtVatNo.Text.Trim()) + "'" + "WHERE PARTY_ID = " + lngSearchId + ""; if (dmlService.J_ExecSql(strSQL) == false) { txtPartyName.Select(); return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.EditModeSave); // all controls are cleared ClearControls(); // Refresh the view grid strSQL = strQuery + "ORDER BY " + strOrderBy; if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } // change the buttons status lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); BtnDelete.BackColor = Color.LightGray; BtnDelete.Enabled = false; ControlVisible(false); dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "PARTY_ID", lngSearchId); break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { string strLastDate = string.Empty; //----------------------------------------------------------- if (mskLastDate.Text == " / /") { strLastDate = "null"; } else { strLastDate = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskLastDate.Text) + cmnService.J_DateOperator(); } switch (lblMode.Text) { case J_Mode.Add: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtPrefix) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // Area Code Logic //mf.MF_GetAreaCode(dmlService.J_pCommand, J_Var.J_pBranchCode) // insert query & execution strSQL = "INSERT INTO MST_INVOICE_SERIES (" + " BRANCH_ID," + " COMPANY_ID," + " PREFIX," + " START_NO," + " LAST_NO," + " LAST_DATE," + " HEADER_DISPLAY_TEXT," + " USER_ID," + " CREATE_DATE) " + " VALUES( " + J_Var.J_pBranchId + "," + " " + Convert.ToInt32(Support.GetItemData(cmbCompanyName, cmbCompanyName.SelectedIndex)) + "," + " '" + cmnService.J_ReplaceQuote(txtPrefix.Text.Trim()) + "'," + " " + Convert.ToInt32(cmnService.J_NumericData(txtStartNo)) + "," + " " + Convert.ToInt32(cmnService.J_NumericData(txtStartNo)) + "," + " " + strLastDate + "," + " '" + cmnService.J_ReplaceQuote(txtDisplayText.Text.Trim()) + "'," + " " + J_Var.J_pUserId + "," + " " + cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(dmlService.J_ReturnServerDate()) + cmnService.J_DateOperator() + ")"; if (dmlService.J_ExecSql(strSQL) == false) { cmbCompanyName.Select(); return; } // get last inserted area id as per branch & user lngSearchId = dmlService.J_ReturnMaxValue("MST_INVOICE_SERIES", "INVOICE_SERIES_ID", " BRANCH_ID = " + J_Var.J_pBranchId + " " + "AND USER_ID = " + J_Var.J_pUserId + ""); if (lngSearchId == 0) { return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.AddModeSave); // all controls are cleared ClearControls(); cmbCompanyName.Select(); break; case J_Mode.Edit: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtPrefix) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // update query & execution strSQL = "UPDATE MST_INVOICE_SERIES " + "SET COMPANY_ID = " + Convert.ToInt32(Support.GetItemData(cmbCompanyName, cmbCompanyName.SelectedIndex)) + "," + " PREFIX = '" + cmnService.J_ReplaceQuote(txtPrefix.Text.Trim()) + "'," + " START_NO = " + Convert.ToInt32(cmnService.J_NumericData(txtStartNo)) + "," + " LAST_NO = " + Convert.ToInt32(cmnService.J_NumericData(txtStartNo)) + "," + " LAST_DATE = " + strLastDate + "," + " HEADER_DISPLAY_TEXT = '" + cmnService.J_ReplaceQuote(txtDisplayText.Text.Trim()) + "' " + "WHERE INVOICE_SERIES_ID = " + lngSearchId + ""; if (dmlService.J_ExecSql(strSQL) == false) { cmbCompanyName.Select(); return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.EditModeSave); // all controls are cleared ClearControls(); // Refresh the view grid strSQL = strQuery + "ORDER BY " + strOrderBy; if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } // change the buttons status lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); BtnDelete.BackColor = Color.LightGray; BtnDelete.Enabled = false; ControlVisible(false); dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "INVOICE_SERIES_ID", lngSearchId); break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void BtnSave_Click(object sender, EventArgs e) { try { // All validation if (ValidateFields() == false) { return; } // Transaction is started dmlService.J_BeginTransaction(); //--------------------------------------------- strSQL = @" UPDATE MST_PARTY SET MOBILE_NO = '" + cmnService.J_ReplaceQuote(txtMobileNo.Text.Trim()) + @"', EMAIL_ID = '" + cmnService.J_ReplaceQuote(txtEmailID.Text.Trim()) + @"', CONTACT_PERSON = '" + cmnService.J_ReplaceQuote(txtContactPersonName.Text.Trim()) + @"' WHERE PARTY_ID = " + lngPartyId; if (dmlService.J_ExecSql(strSQL) == false) { //Rollback Transaction dmlService.J_Rollback(); return; } //--------------------------------------------- //Commit Transaction //--------------------------------------------- dmlService.J_Commit(); //--------------------------------------------- BS.BS_PartyContactPerson = cmnService.J_ReplaceQuote(txtContactPersonName.Text.Trim()); BS.BS_PartyMobNo = cmnService.J_ReplaceQuote(txtMobileNo.Text.Trim()); BS.BS_PartyEmailId = cmnService.J_ReplaceQuote(txtEmailID.Text.Trim()); // if (chkSMS.Checked == true) { BS.BS_PartySendSMS = true; } else { BS.BS_PartySendSMS = false; } // if (chkEmail.Checked == true) { BS.BS_PartySendEmail = true; } else { BS.BS_PartySendEmail = false; } //--------------------------------------------- BS.BS_SaveInvoiceStatus = true; dmlService.Dispose(); this.Close(); this.Dispose(); } catch (Exception err) { //Rollback Transaction dmlService.J_Rollback(); cmnService.J_UserMessage(err.Message); } }
private void Insert_Update_Delete_Data() { try { switch (lblMode.Text) { case J_Mode.Add: // all validations if (ValidateFields() == false) { return; } // save confirmation message if (cmnService.J_SaveConfirmationMessage(ref cmbUserId) == true) { return; } // begin the transaction dmlService.J_BeginTransaction(); // delete query & execution strSQL = "DELETE FROM MST_USER_RIGHTS " + " WHERE USER_ID = " + Convert.ToInt64(Support.GetItemData(cmbUserId, cmbUserId.SelectedIndex)) + " "; if (dmlService.J_ExecSql(strSQL) == false) { cmbUserId.Select(); return; } // selected menu is inserted foreach (DataGridViewRow row in grdvDescription.Rows) { if (row.Cells[0].Value != null && (bool)row.Cells[0].Value == true) { strSQL = "INSERT INTO MST_USER_RIGHTS(" + " USER_ID," + " MENU_ID)" + "VALUES(" + " " + Convert.ToInt64(Support.GetItemData(cmbUserId, cmbUserId.SelectedIndex)) + "," + " " + Convert.ToInt64(Convert.ToString(row.Cells[1].Value)) + ")"; if (dmlService.J_ExecSql(strSQL) == false) { cmbUserId.Select(); return; } } } // transaction is commited dmlService.J_Commit(); // display the message in status bur cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, "Menu rights are successfully completed"); // all controls are cleared ClearControls(); cmbUserId.Select(); break; case J_Mode.Edit: break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { switch (lblMode.Text) { case J_Mode.Add: break; case J_Mode.Edit: //***** For Modify //----------------------------------------------------------- if (ValidateFields() == false) { return; } //--Assigning Cancellation Status to a variable //----------------------------------------------------------- dmlService.J_BeginTransaction(); //----------------------------------------------------------- string strAccountEntryDate = "null"; string strBankDate = "null"; if (!dtService.J_IsBlankDateCheck(ref mskAccountEntryDate, J_ShowMessage.NO)) { strAccountEntryDate = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskAccountEntryDate.Text) + cmnService.J_DateOperator(); } if (!dtService.J_IsBlankDateCheck(ref mskBankDate, J_ShowMessage.NO)) { strBankDate = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskBankDate.Text) + cmnService.J_DateOperator(); } //UPDATING HEADER RECORD strSQL = "UPDATE TRN_INVOICE_HEADER " + "SET PAYMENT_TYPE_ID = " + Support.GetItemData(cmbPaymentType, cmbPaymentType.SelectedIndex) + ", " + " BANK_ID = " + Support.GetItemData(cmbBank, cmbBank.SelectedIndex) + ", " + " REFERENCE_NO = '" + cmnService.J_ReplaceQuote(txtReference.Text) + "', " + " ACCOUNT_ENTRY_DATE = " + strAccountEntryDate + ", " + " BANK_STATEMENT_DATE = " + strBankDate + " " + "WHERE INVOICE_HEADER_ID = " + lngSearchId; //---------------------------------------------------------- if (dmlService.J_ExecSql(dmlService.J_pCommand, strSQL) == false) { cmbPaymentType.Select(); return; } if (lngPartyId > 0) { //Updating the Party Category strSQL = "UPDATE MST_PARTY " + "SET PARTY_CATEGORY_ID = " + Support.GetItemData(cmbPartyCategory, cmbPartyCategory.SelectedIndex) + " " + "WHERE PARTY_ID = " + lngPartyId; //---------------------------------------------------------- if (dmlService.J_ExecSql(dmlService.J_pCommand, strSQL) == false) { cmbPaymentType.Select(); return; } } //----------------------------------------------------------- dmlService.J_Commit(); cmnService.J_PanelMessage(0, J_Msg.EditModeSave); //----------------------------------------------------------- ClearControls(); //----------------------------------------------------------- strSQL = strQuery + "ORDER BY " + strOrderBy; //----------------------------------------------------------- if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } //----------------------------------------------------------- lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); //----------------------------------------------------------- ControlVisible(false); //----------------------------------------------------------- dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "INVOICE_HEADER_ID", lngSearchId); break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { switch (lblMode.Text) { case J_Mode.Add: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtTaxDesc) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // Area Code Logic //mf.MF_GetAreaCode(dmlService.J_pCommand, J_Var.J_pBranchCode) // insert query & execution strSQL = "INSERT INTO MST_TAX (" + " BRANCH_ID," + " TAX_DESC," + " TAX_RATE," + " USER_ID," + " CREATE_DATE) " + " VALUES( " + J_Var.J_pBranchId + "," + " '" + cmnService.J_ReplaceQuote(txtTaxDesc.Text.Trim().ToUpper()) + "'," + " " + Convert.ToDouble(cmnService.J_ReplaceQuote(txtTaxPercentage.Text.Trim())) + "," + " " + J_Var.J_pUserId + "," + " " + cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(dmlService.J_ReturnServerDate()) + cmnService.J_DateOperator() + ")"; if (dmlService.J_ExecSql(strSQL) == false) { txtTaxDesc.Select(); return; } // get last inserted tax id as per branch & user lngSearchId = dmlService.J_ReturnMaxValue("MST_TAX", "TAX_ID", " BRANCH_ID = " + J_Var.J_pBranchId + " " + "AND USER_ID = " + J_Var.J_pUserId + ""); if (lngSearchId == 0) { return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.AddModeSave); // all controls are cleared ClearControls(); txtTaxDesc.Select(); break; case J_Mode.Edit: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtTaxDesc) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // update query & execution strSQL = "UPDATE MST_TAX " + "SET TAX_DESC = '" + cmnService.J_ReplaceQuote(txtTaxDesc.Text.Trim().ToUpper()) + "'," + " TAX_RATE = " + Convert.ToDouble(cmnService.J_ReplaceQuote(txtTaxPercentage.Text.Trim())) + " " + "WHERE TAX_ID = " + lngSearchId + ""; if (dmlService.J_ExecSql(strSQL) == false) { txtTaxDesc.Select(); return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.EditModeSave); // all controls are cleared ClearControls(); // Refresh the view grid strSQL = strQuery + "ORDER BY " + strOrderBy; if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } // change the buttons status lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); BtnDelete.BackColor = Color.LightGray; BtnDelete.Enabled = false; ControlVisible(false); dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "TAX_ID", lngSearchId); break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { switch (lblMode.Text) { case J_Mode.Add: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtCompanyName) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // insert query & execution strSQL = "INSERT INTO MST_COMPANY (" + " BRANCH_ID," + " COMPANY_NAME," + " ADDRESS1," + " ADDRESS2," + " ADDRESS3," + " CITY," + " PIN," + " CONTACT_NO," + " FAX," + " EMAIL_ID," + " WEB_SITE," + " CONTACT_PERSON," + " SIGNATORY," + " VAT_NO," + " CST_NO," + " SERVICE_TAX_NO," + " PAN," + " USER_ID," + " CREATE_DATE, " + " CIN_NO, " + " MAX_DAYS_PERMIT, " + " BANK_DETAIL1, " + //-- 2016/02/18 ANIK " BANK_DETAIL2, " + " BANK_DETAIL3, " + " BANK_DETAIL4, " + " BANK_DETAIL5)" + " VALUES( " + J_Var.J_pBranchId + "," + " '" + cmnService.J_ReplaceQuote(txtCompanyName.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtAddress1.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtAddress2.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtAddress3.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtCity.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtPin.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtContactNo.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtFax.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtEmailID.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtWebsite.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtContactPersonName.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtSignatory.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtVATNo.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtCSTNo.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtServiceTaxNo.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtPAN.Text.Trim()) + "'," + " " + J_Var.J_pUserId + "," + " " + cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(dmlService.J_ReturnServerDate()) + cmnService.J_DateOperator() + ", " + " '" + cmnService.J_ReplaceQuote(txtCINNo.Text.Trim()) + "'," + " " + cmnService.J_ReplaceQuote(txtMaxPermitedDays.Text.Trim()) + ", " + " '" + cmnService.J_ReplaceQuote(txtBankDetails1.Text.Trim()) + "', " + //-- 2016/02/18 ANIK " '" + cmnService.J_ReplaceQuote(txtBankDetails2.Text.Trim()) + "', " + " '" + cmnService.J_ReplaceQuote(txtBankDetails3.Text.Trim()) + "', " + " '" + cmnService.J_ReplaceQuote(txtBankDetails4.Text.Trim()) + "', " + " '" + cmnService.J_ReplaceQuote(txtBankDetails5.Text.Trim()) + "')"; if (dmlService.J_ExecSql(strSQL) == false) { txtCompanyName.Select(); return; } // get last inserted area id as per branch & user lngSearchId = dmlService.J_ReturnMaxValue("MST_COMPANY", "COMPANY_ID", " BRANCH_ID = " + J_Var.J_pBranchId + " " + "AND USER_ID = " + J_Var.J_pUserId + ""); if (lngSearchId == 0) { return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.AddModeSave); // all controls are cleared ClearControls(); txtCompanyName.Select(); break; case J_Mode.Edit: // all validation if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtCompanyName) == true) { return; } // set the transaction as begin dmlService.J_BeginTransaction(); // update query & execution strSQL = "UPDATE MST_COMPANY " + "SET COMPANY_NAME = '" + cmnService.J_ReplaceQuote(txtCompanyName.Text.Trim()) + "'," + " ADDRESS1 = '" + cmnService.J_ReplaceQuote(txtAddress1.Text.Trim()) + "'," + " ADDRESS2 = '" + cmnService.J_ReplaceQuote(txtAddress2.Text.Trim()) + "'," + " ADDRESS3 = '" + cmnService.J_ReplaceQuote(txtAddress3.Text.Trim()) + "'," + " CITY = '" + cmnService.J_ReplaceQuote(txtCity.Text.Trim()) + "'," + " PIN = '" + cmnService.J_ReplaceQuote(txtPin.Text.Trim()) + "'," + " CONTACT_NO = '" + cmnService.J_ReplaceQuote(txtContactNo.Text.Trim()) + "'," + " FAX = '" + cmnService.J_ReplaceQuote(txtFax.Text.Trim()) + "'," + " EMAIL_ID = '" + cmnService.J_ReplaceQuote(txtEmailID.Text.Trim()) + "'," + " WEB_SITE = '" + cmnService.J_ReplaceQuote(txtWebsite.Text.Trim()) + "'," + " CONTACT_PERSON = '" + cmnService.J_ReplaceQuote(txtContactPersonName.Text.Trim()) + "'," + " SIGNATORY = '" + cmnService.J_ReplaceQuote(txtSignatory.Text.Trim()) + "'," + " VAT_NO = '" + cmnService.J_ReplaceQuote(txtVATNo.Text.Trim()) + "'," + " CST_NO = '" + cmnService.J_ReplaceQuote(txtCSTNo.Text.Trim()) + "'," + " SERVICE_TAX_NO = '" + cmnService.J_ReplaceQuote(txtServiceTaxNo.Text.Trim()) + "'," + " PAN = '" + cmnService.J_ReplaceQuote(txtPAN.Text.Trim()) + "', " + " CIN_NO = '" + cmnService.J_ReplaceQuote(txtCINNo.Text.Trim()) + "', " + " MAX_DAYS_PERMIT = " + cmnService.J_ReplaceQuote(txtMaxPermitedDays.Text.Trim()) + ", " + " BANK_DETAIL1 = '" + cmnService.J_ReplaceQuote(txtBankDetails1.Text.Trim()) + "', " + //-- 2016/02/18 ANIK " BANK_DETAIL2 = '" + cmnService.J_ReplaceQuote(txtBankDetails2.Text.Trim()) + "', " + " BANK_DETAIL3 = '" + cmnService.J_ReplaceQuote(txtBankDetails3.Text.Trim()) + "', " + " BANK_DETAIL4 = '" + cmnService.J_ReplaceQuote(txtBankDetails4.Text.Trim()) + "', " + " BANK_DETAIL5 = '" + cmnService.J_ReplaceQuote(txtBankDetails5.Text.Trim()) + "' " + "WHERE COMPANY_ID = " + lngSearchId + ""; if (dmlService.J_ExecSql(strSQL) == false) { txtCompanyName.Select(); return; } // Transaction is commited dmlService.J_Commit(); // after insert data, the message is displayed cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.EditModeSave); // all controls are cleared ClearControls(); // Refresh the view grid strSQL = strQuery + "ORDER BY " + strOrderBy; if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } // change the buttons status lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); BtnDelete.BackColor = Color.LightGray; BtnDelete.Enabled = false; ControlVisible(false); dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "COMPANY_ID", lngSearchId); break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { switch (lblMode.Text) { case J_Mode.Add: if (ValidateFields() == false) { return; } //----------------------------------------------------------- if (cmnService.J_SaveConfirmationMessage(ref mskInvoiceDate) == true) { return; } //----------------------------------------------------------- //Generating inwords for the amounts string strAccountEntryDate = "null"; string strBankDate = "null"; if (!dtService.J_IsBlankDateCheck(ref mskAccountEntryDate, J_ShowMessage.NO)) { strAccountEntryDate = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskAccountEntryDate.Text) + cmnService.J_DateOperator(); } if (!dtService.J_IsBlankDateCheck(ref mskBankDate, J_ShowMessage.NO)) { strBankDate = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskBankDate.Text) + cmnService.J_DateOperator(); } //----------------------------------------------------------- dmlService.J_BeginTransaction(); //----------------------------------------------------------- strSQL = @"INSERT INTO TRN_INVOICE_HEADER (BRANCH_ID, FAYEAR_ID, COMPANY_ID, INVOICE_DATE, TRAN_TYPE, NET_AMOUNT, BANK_STATEMENT_DATE, ACCOUNT_ENTRY_DATE, BANK_ID, PAYMENT_TYPE_ID, REFERENCE_NO, REMARKS, USER_ID) " + " VALUES " + " (" + J_Var.J_pBranchId + "," + " " + J_Var.J_pFAYearId + "," + " " + Support.GetItemData(cmbCompany, cmbCompany.SelectedIndex) + ", " + " " + cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskInvoiceDate.Text) + cmnService.J_DateOperator() + ", " + " 'UN', " + " " + Convert.ToDouble(txtAmount.Text) + ", " + " " + strBankDate + ", " + " " + strAccountEntryDate + ", " + " " + Support.GetItemData(cmbBank, cmbBank.SelectedIndex) + ", " + " " + Support.GetItemData(cmbPaymentType, cmbPaymentType.SelectedIndex) + ", " + " '" + cmnService.J_ReplaceQuote(txtReference.Text) + "', " + " '" + cmnService.J_ReplaceQuote(txtRemarks.Text) + "', " + " " + Convert.ToInt32(J_Var.J_pUserId) + " )"; //----------------------------------------------------------- if (dmlService.J_ExecSql(strSQL) == false) { mskInvoiceDate.Select(); return; } //----------------------------------------------------------- dmlService.J_Commit(); cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.AddModeSave); //----------------------------------------------------------- ClearControls(); mskInvoiceDate.Text = dmlService.J_ReturnServerDate(); //----------------------------------------------------------- cmnService.J_UserMessage("Record Saved"); //----------------------------------------------------------- mskInvoiceDate.Select(); break; case J_Mode.Edit: //***** For Modify //----------------------------------------------------------- if (ValidateFields() == false) { return; } //--Assigning Cancellation Status to a variable //----------------------------------------------------------- dmlService.J_BeginTransaction(); //----------------------------------------------------------- strAccountEntryDate = "null"; strBankDate = "null"; if (!dtService.J_IsBlankDateCheck(ref mskAccountEntryDate, J_ShowMessage.NO)) { strAccountEntryDate = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskAccountEntryDate.Text) + cmnService.J_DateOperator(); } if (!dtService.J_IsBlankDateCheck(ref mskBankDate, J_ShowMessage.NO)) { strBankDate = cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskBankDate.Text) + cmnService.J_DateOperator(); } int intCancellationFlag = 0; if (chkCancelled.Checked == true) { intCancellationFlag = 1; } //UPDATING HEADER RECORD strSQL = "UPDATE TRN_INVOICE_HEADER " + "SET PAYMENT_TYPE_ID = " + Support.GetItemData(cmbPaymentType, cmbPaymentType.SelectedIndex) + ", " + " BANK_ID = " + Support.GetItemData(cmbBank, cmbBank.SelectedIndex) + ", " + " REFERENCE_NO = '" + cmnService.J_ReplaceQuote(txtReference.Text) + "', " + " ACCOUNT_ENTRY_DATE = " + strAccountEntryDate + ", " + " BANK_STATEMENT_DATE = " + strBankDate + ", " + " INVOICE_DATE = " + cmnService.J_DateOperator() + dtService.J_ConvertMMddyyyy(mskInvoiceDate.Text) + cmnService.J_DateOperator() + ", " + " NET_AMOUNT = " + Convert.ToDouble(txtAmount.Text) + ", " + " REMARKS = '" + cmnService.J_ReplaceQuote(txtRemarks.Text) + "', " + " CANCELLATION_FLAG = " + intCancellationFlag + " " + "WHERE INVOICE_HEADER_ID = " + lngSearchId; //---------------------------------------------------------- if (dmlService.J_ExecSql(dmlService.J_pCommand, strSQL) == false) { cmbPaymentType.Select(); return; } //----------------------------------------------------------- dmlService.J_Commit(); cmnService.J_PanelMessage(0, J_Msg.EditModeSave); //----------------------------------------------------------- ClearControls(); //----------------------------------------------------------- strSQL = strQuery + "ORDER BY " + strOrderBy; //----------------------------------------------------------- if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } //----------------------------------------------------------- lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); cmbCompany.Enabled = true; //----------------------------------------------------------- ControlVisible(false); //----------------------------------------------------------- dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "INVOICE_HEADER_ID", lngSearchId); break; case J_Mode.Delete: if (cmnService.J_UserMessage("Are you sure you want to delete the selected Payment entry?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } dmlService.J_BeginTransaction(); strSQL = "DELETE FROM TRN_INVOICE_HEADER WHERE INVOICE_HEADER_ID = " + lngSearchId; dmlService.J_ExecSql(strSQL); dmlService.J_Commit(); cmnService.J_PanelMessage(0, J_Msg.DeleteMode); //----------------------------------------------------------- strSQL = strQuery + "ORDER BY " + strOrderBy; //----------------------------------------------------------- if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } //----------------------------------------------------------- lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); //----------------------------------------------------------- dmlService.J_setGridPosition(ref this.ViewGrid, dsetGridClone, "INVOICE_HEADER_ID", lngSearchId); break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { string strLoginId = string.Empty; int intCategory = 0; switch (lblMode.Text) { case J_Mode.Add: // all validations if (ValidateFields() == false) { return; } // Save Confirmation Message if (cmnService.J_SaveConfirmationMessage(ref txtUserName) == true) { return; } intCategory = Convert.ToInt32(chkActiveInactive.Checked == true ? "0" : "1"); // Begin Transaction dmlService.J_BeginTransaction(); strSQL = "INSERT INTO MST_USER (" + " BRANCH_ID," + " USER_CODE," + " DISPLAY_NAME," + " LOGIN_ID," + " USER_PASSWORD," + " USER_CATEGORY) " + " VALUES( " + J_Var.J_pBranchId + "," + " ''," + " '" + cmnService.J_ReplaceQuote(txtUserName.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtLoginId.Text.Trim()) + "'," + " '" + cmnService.J_ReplaceQuote(txtPassword.Text.Trim()) + "'," + " " + intCategory + ")"; if (dmlService.J_ExecSql(strSQL) == false) { txtUserName.Select(); return; } lngSearchId = dmlService.J_ReturnMaxValue("MST_USER", "USER_ID", " BRANCH_ID = " + J_Var.J_pBranchId + " " + "AND " + cmnService.J_SQLDBFormat("LOGIN_ID", J_SQLColFormat.UCase) + " = '" + cmnService.J_ReplaceQuote(txtLoginId.Text.Trim().ToUpper()) + "'"); if (lngSearchId == 0) { return; } dmlService.J_Commit(); cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.AddModeSave); ClearControls(); txtUserName.Select(); break; case J_Mode.Edit: // For Modify if (ValidateFields() == false) { return; } if (cmnService.J_SaveConfirmationMessage(ref txtUserName) == true) { return; } intCategory = Convert.ToInt32(chkActiveInactive.Checked == true ? "0" : "1"); // Begin Transaction dmlService.J_BeginTransaction(); strSQL = "UPDATE MST_USER " + "SET DISPLAY_NAME = '" + cmnService.J_ReplaceQuote(txtUserName.Text.Trim()) + "'," + " USER_CATEGORY = " + intCategory + " "; // If reset password is checked then update password too if (chkResetPassword.Checked == true) { strSQL = strSQL + ", USER_PASSWORD = '******' "; } strSQL = strSQL + "WHERE USER_ID = " + lngSearchId + ""; if (dmlService.J_ExecSql(strSQL) == false) { txtUserName.Select(); return; } dmlService.J_Commit(); cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.EditModeSave); ClearControls(); strSQL = strQuery + "ORDER BY " + strOrderBy; if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); BtnDelete.BackColor = Color.LightGray; BtnDelete.Enabled = false; ControlVisible(false); dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "USER_ID", lngSearchId); break; case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }
private void Insert_Update_Delete_Data() { try { string strLoginId = string.Empty; int intInactive = 0; switch (lblMode.Text) { #region ADD case J_Mode.Add: //// all validations //if (ValidateFields() == false) return; //// Save Confirmation Message //if (cmnService.J_SaveConfirmationMessage(ref txtOnlineMailBody) == true) return; ////intCategory = Convert.ToInt32(chkActiveInactive.Checked == true ? "0" : "1"); //// Begin Transaction //dmlService.J_BeginTransaction(); //strSQL = "INSERT INTO MST_EMAIL_CATEGORY (" + // " BRANCH_ID," + // " USER_CODE," + // " DISPLAY_NAME," + // " LOGIN_ID," + // " USER_PASSWORD," + // " USER_CATEGORY) " + // " VALUES( " + J_Var.J_pBranchId + "," + // " ''," + // " '" + cmnService.J_ReplaceQuote(txtUserName.Text.Trim()) + "'," + // " '" + cmnService.J_ReplaceQuote(txtLoginId.Text.Trim()) + "'," + // " '" + cmnService.J_ReplaceQuote(txtPassword.Text.Trim()) + "'," + // " " + intCategory + ")"; //if (dmlService.J_ExecSql(strSQL) == false) //{ // txtUserName.Select(); // return; //} //lngSearchId = dmlService.J_ReturnMaxValue("MST_USER", "USER_ID", // " BRANCH_ID = " + J_Var.J_pBranchId + " " + // "AND " + cmnService.J_SQLDBFormat("LOGIN_ID", J_SQLColFormat.UCase) + " = '" + cmnService.J_ReplaceQuote(txtLoginId.Text.Trim().ToUpper()) + "'"); //if (lngSearchId == 0) return; //dmlService.J_Commit(); //cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.AddModeSave); //ClearControls(); //txtUserName.Select(); break; #endregion // #region EDIT case J_Mode.Edit: // For Modify if (ValidateFields() == false) { return; } if (cmnService.J_SaveConfirmationMessage(ref txtOnlineMailBody) == true) { return; } intInactive = Convert.ToInt32(chkInactive.Checked == true ? "1" : "0"); // Begin Transaction dmlService.J_BeginTransaction(); strSQL = "UPDATE MST_EMAIL_CATEGORY " + "SET EMAIL_SUBJECT_ONLINE ='" + cmnService.J_ReplaceQuote(txtEmailSubjectOnline.Text.Trim()) + "'," + " EMAIL_SUBJECT_OFFLINE ='" + cmnService.J_ReplaceQuote(txtEmailSubjectOffline.Text.Trim()) + "'," + " EMAIL_SUBJECT_DESPATCH ='" + cmnService.J_ReplaceQuote(txtEmailSubjectItemDispatched.Text.Trim()) + "'," + " EMAIL_BODY_ONLINE ='" + cmnService.J_ReplaceQuote(txtOnlineMailBody.Text.Trim()) + "'," + " EMAIL_BODY_OFFLINE ='" + cmnService.J_ReplaceQuote(txtOfflineMailBody.Text.Trim()) + "'," + " EMAIL_BODY_DESPATCH ='" + cmnService.J_ReplaceQuote(txtItemsDispatchedMailBody.Text.Trim()) + "'," + " FROM_EMAIL ='" + cmnService.J_ReplaceQuote(txtFromEmail.Text.Trim()) + "'," + " DISPLAY_NAME ='" + cmnService.J_ReplaceQuote(txtDisplayName.Text.Trim()) + "'," + " EMAIL_BCC ='" + cmnService.J_ReplaceQuote(txtBCCEmail.Text.Trim()) + "'," + " INACTIVE_FLAG = " + intInactive + " " + "WHERE EMAIL_TYPE_ID = " + lngSearchId + ""; // If reset password is checked then update password too //if (chkResetPassword.Checked == true) // strSQL = strSQL + ", USER_PASSWORD = '******' "; //strSQL = strSQL + "WHERE EMAIL_TYPE_ID = " + lngSearchId + ""; if (dmlService.J_ExecSql(strSQL) == false) { txtOnlineMailBody.Select(); return; } dmlService.J_Commit(); cmnService.J_PanelMessage(J_PanelIndex.e00_DisplayText, J_Msg.EditModeSave); ClearControls(); strSQL = strQuery + "ORDER BY " + strOrderBy; if (dsetGridClone != null) { dsetGridClone.Clear(); } dsetGridClone = dmlService.J_ShowDataInGrid(ref ViewGrid, strSQL, strMatrix); //Show Data into the Grid if (dsetGridClone == null) { return; } lblMode.Text = J_Mode.View; cmnService.J_StatusButton(this, lblMode.Text); BtnDelete.BackColor = Color.LightGray; BtnDelete.Enabled = false; BtnAdd.BackColor = Color.LightGray; BtnAdd.Enabled = false; BtnSort.BackColor = Color.LightGray; BtnSort.Enabled = false; BtnSearch.BackColor = Color.LightGray; BtnSearch.Enabled = false; ControlVisible(false); dmlService.J_setGridPosition(ref ViewGrid, dsetGridClone, "EMAIL_TYPE_ID", lngSearchId); break; #endregion // case J_Mode.Delete: break; } } catch (Exception err_handler) { dmlService.J_Rollback(); cmnService.J_UserMessage(err_handler.Message); } }