コード例 #1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            frmLedgerConfigurationList objfrm = new frmLedgerConfigurationList();

            objfrm.onAddAllButtonClicked = new frmLedgerConfigurationList.AddAllClick(DisplayList);
            objfrm.lngFormPriv           = lngFormPriv;
            objfrm.Show();
            objfrm.MdiParent = this.MdiParent;
            dtefromDate.Focus();
        }
コード例 #2
0
        private void saveeupdate()
        {
            string strmsg = "", strkey = "", strDG = "";
            long   strVoucherType = '4';

            if (uctxtLedgerNamee.Text == "")
            {
                MessageBox.Show("Cannot be Empty");
                uctxtLedgerNamee.Focus();
                return;
            }



            strkey = uctxtLedgerNamee.Text + dtefromDate.Value.ToString("ddMMyyyy");

            for (int i = 0; i < DG.Rows.Count - 1; i++)
            {
                strDG = strDG + Utility.gCheckNull(DG[0, i].Value.ToString()) + "," + Utility.gCheckNull(DG[1, i].Value.ToString()) + "," + Utility.gCheckNull(DG[2, i].Value.ToString()) + "~";
            }

            if (m_action == 1)
            {
                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;
                    }
                }
                var strResponseInsert = MessageBox.Show("Do You  want to Save?", "Save Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponseInsert == DialogResult.Yes)
                {
                    try
                    {
                        strmsg = accms.mInsertExpenseLedger(strComID, strkey, uctxtLedgerNamee.Text, dtefromDate.Text, strVoucherType, strDG);
                        if (strmsg == "Inseretd...")
                        {
                            if (Utility.gblnAccessControl)
                            {
                                string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, DateTime.Now.ToString("dd/MM/yyyy"), "Ledger Configuration", uctxtLedgerNamee.Text,
                                                                         1, 0, (int)Utility.MODULE_TYPE.mtACCOUNT, "0001");
                            }
                            uctxtLedgerNamee.Text = "";
                            DG.Rows.Clear();
                            uctxtLedgerNamee.Focus();
                        }
                    }
                    catch (Exception EX)
                    {
                        MessageBox.Show(strmsg);
                    }
                }
            }
            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;
                    }
                }
                var strResponseInsert = MessageBox.Show("Do You Want to Update?", "Update Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponseInsert == DialogResult.Yes)
                {
                    try
                    {
                        string i = accms.DeleteLedgerConfig(strComID, StrConfigkey.Text);
                        strmsg = accms.mInsertExpenseLedger(strComID, strkey, uctxtLedgerNamee.Text, dtefromDate.Text, strVoucherType, strDG);
                        if (strmsg == "Inseretd...")
                        {
                            if (Utility.gblnAccessControl)
                            {
                                string strAudit = Utility.gblnAuditTrail(Utility.gstrUserName, DateTime.Now.ToString("dd/MM/yyyy"), "Ledger Configuration", uctxtLedgerNamee.Text,
                                                                         2, 0, (int)Utility.MODULE_TYPE.mtACCOUNT, "0001");
                            }
                            uctxtLedgerNamee.Text = "";
                            DG.Rows.Clear();
                            StrConfigkey.Text        = "";
                            uctxtLedgerNamee.Enabled = true;
                            //uctxtLedgerNamee.Focus();
                            //uctxtLedgerNamee.Select();
                            frmLedgerConfigurationList objfrm = new frmLedgerConfigurationList();
                            objfrm.onAddAllButtonClicked = new frmLedgerConfigurationList.AddAllClick(DisplayList);
                            objfrm.Show();
                            objfrm.MdiParent = this.MdiParent;
                            dtefromDate.Focus();
                        }
                        m_action = 1;
                    }
                    catch (Exception EX)
                    {
                        MessageBox.Show(strmsg);
                    }
                }
            }
        }