private void btnNew_Click(object sender, EventArgs e) { frmGroupConfigurationList objfrm = new frmGroupConfigurationList(); objfrm.lngFormPriv = lngFormPriv; objfrm.intModuleType = intModuleType; objfrm.strFormName = strFoemName; objfrm.intGroup = inttype; objfrm.onAddAllButtonClicked = new frmGroupConfigurationList.AddAllClick(DisplayReqList); objfrm.Show(); objfrm.MdiParent = MdiParent; }
private void btnSave_Click(object sender, EventArgs e) { short i = 0; int intGrpPos = 9999, intDuplicate = 0; if (chkDuplicate.Checked) { intDuplicate = 1; } else { intDuplicate = 0; } if (txtGroupName.Text == "") { MessageBox.Show("Group Name Cannot be Empty"); txtGroupName.Focus(); return; } if (txtUnder.Text == "") { MessageBox.Show("Accounts Type Cannot be Empty"); txtAccountsType.Focus(); return; } if (txtCashFlowType.Text == "") { txtCashFlowType.Text = "Operating Activities"; } else if (txtCashFlowType.Text == Utility.gcEND_OF_LIST) { txtCashFlowType.Text = "Operating Activities"; } if (txtSortingPos.Text != "") { intGrpPos = Convert.ToInt32(txtSortingPos.Text); } else { intGrpPos = 9999; } if (txtSlNo.Text == "") { if (Utility.gblnAccessControl) { if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 1)) { MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } string strDuplicate = Utility.mCheckDuplicateItem(strComID, "ACC_LEDGERGROUP", "GR_NAME", txtGroupName.Text); if (strDuplicate != "") { MessageBox.Show(strDuplicate); txtGroupName.Focus(); return; } var strResponseInsert = MessageBox.Show("Do You want to Save?", "Save Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (strResponseInsert == DialogResult.Yes) { try { i = accms.InsertGroup(strComID, txtGroupName.Text.ToString(), txtUnder.Text.ToString(), txtCashFlowType.Text.ToString(), txtAccountsType.Text.ToString(), txtMobileNo.Text, txtConatctNo.Text, intGrpPos, intDuplicate); if (i == 1) { if (Utility.gblnAccessControl) { string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, DateTime.Now.ToString("dd/MM/yyyy"), strFoemName, txtGroupName.Text, 1, 0, (int)intModuleType, "0001"); } string strUnder = txtUnder.Text; mClear(); txtUnder.Text = strUnder; } else { MessageBox.Show("Error!!!"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } } else { if (Utility.gblnAccessControl) { if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2)) { MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } if (mstrOLDGroup.Trim().ToUpper() != txtGroupName.Text.Trim().ToUpper()) { string strDuplicate = Utility.mCheckDuplicateItem(strComID, "ACC_LEDGERGROUP", "GR_NAME", txtGroupName.Text); if (strDuplicate != "") { MessageBox.Show(strDuplicate); txtGroupName.Focus(); return; } } var strResponseUpdate = MessageBox.Show("Do You Want to Update?", "Update Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (strResponseUpdate == DialogResult.Yes) { try { i = accms.mUpdateGroup(strComID, Convert.ToUInt32(txtSlNo.Text.ToString()), txtGroupName.Text.ToString(), txtUnder.Text.ToString(), txtCashFlowType.Text.ToString(), txtAccountsType.Text.ToString(), txtMobileNo.Text, txtConatctNo.Text, intGrpPos, intDuplicate); if (i == 1) { if (Utility.gblnAccessControl) { string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, DateTime.Now.ToString("dd/MM/yyyy"), strFoemName, txtGroupName.Text, 2, 0, (int)intModuleType, "0001"); } mClear(); frmGroupConfigurationList objfrm = new frmGroupConfigurationList(); objfrm.lngFormPriv = lngFormPriv; objfrm.intModuleType = intModuleType; objfrm.strFormName = strFoemName; objfrm.intGroup = inttype; objfrm.onAddAllButtonClicked = new frmGroupConfigurationList.AddAllClick(DisplayReqList); objfrm.Show(); objfrm.MdiParent = MdiParent; } else { MessageBox.Show("Error!!!"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } } }