private void backworker_DoWork(object sender, DoWorkEventArgs e)
        {
            switch (m_process)
            {
            case _process.form_load:
            {
                datam.SystemInitializer();
                using (var xd = new xing())
                {
                    datam.GetPledgeSettings(xd);
                    datam.GetCurrentPledges(xd);
                }
                break;
            }

            case _process.check_updates:
            {
                using (var xd = new xing())
                {
                    datam.GetPledgeSettings(xd);
                    datam.GetCurrentPledges(xd);
                    xd.CommitTransaction();
                }
                break;
            }
            }
        }
Exemplo n.º 2
0
        private void backworker_DoWork(object sender, DoWorkEventArgs e)
        {
            switch (m_process)
            {
            case _process.form_loading:
            {
                datam.SystemInitializer();
                using (var xd = new xing())
                {
                    using (var _dr = xd.SelectCommand("select us_id from pcuser_tb"))
                    {
                        while (_dr.Read())
                        {
                            m_DataEntrants.Add(_dr[0].ToInt32());
                        }
                    }
                    xd.CommitTransaction();
                }

                break;
            }

            case _process.update_after_insert:
            {
                break;
            }
            }
        }
        private void addAnotherPledgeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var _obj = fGrid.SelectedRows[0].Tag as ic.pledgeC;

            if (m_pledge_settings.end_fs_id < sdata.CURR_FS.fs_id)
            {
                dbm.ErrorMessage("This Pledge Account Has Expired", "Expired Pledge Account");
                return;
            }
            using (var _fm = new AddToPledgeMaker())
            {
                _fm.Owner = this;
                _fm.Tag   = _obj;
                _fm.ShowDialog();
                if (_fm.Tag == null)
                {
                    using (var xd = new xing())
                    {
                        datam.GetCurrentPledges(xd);
                        xd.CommitTransaction();
                    }
                    _obj = datam.DATA_CURRENT_PLEDGES[_obj.pl_id];
                    UpdateRecord(_obj);
                    if (this.Tag != null)
                    {
                        this.Tag = null;
                    }
                }
            }
        }
        private void LoadTabs()
        {
            if (comboyear.SelectedItem == null | comboyear.SelectedIndex == -1)
            {
                return;
            }
            datam.ShowWaitForm("Loading Data,Please Wait");
            comboyear.Enabled = false;
            Application.DoEvents();
            using (var xd = new xing())
            {
                datam.GetYearExpenses(comboyear.SelectedItem.ToString().ToInt32(), xd);
                xd.CommitTransaction();
            }
            if (tabControl1.SelectedTab == tabItem1 & !tab1_loaded)
            {
                tab1_loaded = true;
                ClearGridCells(fGrid);
                LoadMonthData();
            }

            if (tabControl1.SelectedTab == tabItem3 & !tab2_loaded)
            {
                tab2_loaded = true;
                ClearGridCells(fGridnormal);
                LoadQuarterData();
            }
            comboyear.Enabled = true;
            datam.HideWaitForm();
        }
Exemplo n.º 5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!dbm.InsertToDatabaseWarning())
            {
                return;
            }
            ic.displineC obj = new MTOMS.ic.displineC();
            obj.cat_id = selected_cat.cat_id;
            obj.mem_id = selected_mem_obj.mem_id;
            if (txt_details.Text.Trim().Length != 0)
            {
                obj.reason = txt_details.Text.Trim();
            }
            if (txt_action.Text.Trim().Length != 0)
            {
                obj.action = txt_action.Text.Trim();
            }
            obj.start_date  = selected_start_date;
            obj.start_fs_id = selected_start_fs_id;
            obj.end_date    = selected_end_date;
            obj.end_fs_id   = selected_end_fs_id;
            obj.e_date      = datam.CURR_DATE;
            obj.pc_us_id    = datam.PC_US_ID;
            obj.pc_us_name  = datam.PC_US_NAME;
            obj.lch_id      = datam.LCH_ID;
            obj.lch_type_id = datam.LCH_TYPE_ID;
            xing xd = new xing();

            save_Mem_displine(obj, ref xd);
            xd.CommitTransaction();
            dbm.RecordInsertedMessage();
            btnCancel.PerformClick();
        }
        private void ExpensesYearAnalysis_Load(object sender, EventArgs e)
        {
            datam.SecurityCheck();
            xso.xso.Intialize();
            datam.SystemInitializer();
            fGrid.Rows.Clear();
            fGridnormal.Rows.Clear();
            LoadYears();
            InitializeTab1GridColumns();
            InitializeTab2GridColumns();


            using (var xd = new xing())
            {
                datam.InitExpenses(xd);
                xd.CommitTransaction();
            }
            m_SHOW_TYPES = new Dictionary <string, _show_type>();
            m_SHOW_TYPES.Add("Expenses Only", _show_type.expenses_only);
            //m_SHOW_TYPES.Add("CR Payments Only", _show_type.payments_only);
            //m_SHOW_TYPES.Add("Expenses & CR Payments", _show_type.payments_expenses);
            app_working = true;
            foreach (var k in m_SHOW_TYPES.Keys)
            {
                comboBoxEx1.Items.Add(k);
            }
            comboBoxEx1.SelectedIndex = 0;
            app_working = false;
            // CreateDefaultRowsDepartment();
            CreateDefaultRowsCategory();
            this.VisibleChanged += new EventHandler(ExpensesYearAnalysis_VisibleChanged);
        }
Exemplo n.º 7
0
        private void deleteRecordToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string _str = "Are You Sure You Want To Delete This Entry";

            if (!dbm.WarningMessage(_str, "Delete Warning"))
            {
                return;
            }
            ic.batch_no_SettingC _obj = fGrid.SelectedRows[0].Tag as ic.batch_no_SettingC;
            if (_obj != null)
            {
                using (var xd = new xing())
                {
                    if (xd.SingleUpdateCommand(string.Format("delete from off_batch_no_settings_tb where un_id={0} and entrant_count=0", _obj.un_id)))
                    {
                        xd.CommitTransaction();
                        fGrid.Rows.RemoveAt(fGrid.Rows[_obj.un_id.ToString()].Index);
                    }
                    else
                    {
                        MessageBox.Show("This Batch No Is Already Attached To Some Receipts,Cancel Them In Order To Proceed", "Delete Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
            }
        }
        private void deleteClientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("You Cannot Perform This Operation At The Moment", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;

            var    _unit = curr_node.Tag as ic.church_sub_unitC;
            string _str  = "Are You Sure You Want To The Delete The Selected Expense Account";

            using (var xd = new xing())
            {
                //if (xd.ExecuteScalarInt(string.Format("select count(dept_id) from dept_member_tb where dept_id={0} limit 1", _dept.dept_id)) > 0)
                //{
                //    dbm.ErrorMessage("You Cannot Delete This Department,It Has References In Other Tables", "Delete Failure");
                //    return;
                //}
                if (!dbm.WarningMessage(_str, "Delete Warning"))
                {
                    return;
                }
                xd.SingleDeleteCommandExp("church_sub_unit_tb", new string[]
                {
                    "sb_unit_id"
                }, new int[] { _unit.sb_unit_id });
                xd.CommitTransaction();
            }
            if (!is_edited)
            {
                is_edited = true;
            }
            datam.DATA_CHURCH_SUB_UNIT.Remove(_unit.sb_unit_id);
            advTree1.SelectedNode.Remove();
        }
        private void deleteMemberPlegdeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var _fm = new SdaHelperManager.ConfirmWPwd())
            {
                _fm.ShowDialog();
                if (_fm.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            var _obj = fGrid.SelectedRows[0].Tag as ic.pledgeC;

            _obj.pledge_status = em.pledge_statusS.deleted;
            string _str = "Are You Sure You Want To Delete This Member Pledge ??";

            using (var xd = new xing())
            {
                var _d_obj = xd.ExecuteScalarObject("select pl_status from pledge_master_tb where pl_id=" + _obj.pl_id);
                if (_d_obj != null)
                {
                    if (_d_obj.ToInt16() == em.pledge_statusS.deleted.ToInt16())
                    {
                        MessageBox.Show("You Have Already Deleted This Member Pledge", "Already Deleted");
                        return;
                    }
                }
                if (!dbm.WarningMessage(_str, "Delete Warning"))
                {
                    return;
                }
                //
                xd.SingleUpdateCommandALL("pledge_master_tb", new string[] { "pl_status", "pl_id" }, new object[]
                {
                    em.pledge_statusS.deleted.ToInt16(),
                    _obj.pl_id
                }, 1);
                //
                xd.SingleUpdateCommandALL("pledge_payment_mvt_tb", new string[] { "status", "pl_id" }, new object[]
                {
                    0,
                    _obj.pl_id
                }, 1);
                //
                xd.SingleUpdateCommandALL("pledge_addition_tb", new string[] { "pl_status", "pl_id" }, new object[]
                {
                    em.pledge_statusS.deleted.ToInt16(),
                    _obj.pl_id
                }, 1);

                //
                accn.PledgeSummary(xd, (_obj.amount_pledged * -1), (_obj.amount_paid * -1), _obj.pls_id);
                //
                xd.CommitTransaction();
            }
            fGrid.Rows.RemoveAt(fGrid.Rows[_obj.pl_id.ToString()].Index);
            if (this.Tag != null)
            {
                this.Tag = null;
            }
        }
 private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (curr_node != null)
     {
         if ((advTree1.SelectedNode.Tag != null && (advTree1.SelectedNode.Tag as ic.accountC).is_sys_account))
         {
             MessageBox.Show("Cannot Edit This Account Because It Is A System Account", "System Account Error");
             return;
         }
         var _account = curr_node.Tag as ic.accountC;
         if (_account != null)
         {
             string _str = "Are You Sure You Want To The Delete The Selected Account";
             if (!dbm.WarningMessage(_str, "Delete Warning"))
             {
                 return;
             }
             using (var xd = new xing())
             {
                 xd.InsertUpdateDelete(string.Format("delete from accounts_tb where account_id={0}", _account.account_id));
                 datam.DATA_ACCOUNTS.Remove(_account.account_id);
                 advTree1.SelectedNode.Remove();
                 xd.CommitTransaction();
             }
         }
     }
 }
Exemplo n.º 11
0
        private void buttoncreate_Click(object sender, EventArgs e)
        {
            if (fGrid.CurCell != null)
            {
                fGrid.CommitEditCurCell();
            }
            if (!IsValid())
            {
                return;
            }
            string _str = "Are You Sure You Want To Save This Record ??";

            if (!dbm.WarningMessage(_str, "Save Warning"))
            {
                return;
            }
            //
            ic.batch_no_SettingC _obj = new ic.batch_no_SettingC();
            _obj.batch_count = fGrid.Rows["batch_count"].Cells[1].Value.ToInt32();
            _obj.batch_no    = fGrid.Rows["batch_no"].Cells[1].Text.ToUpper();
            _obj.batch_total = fGrid.Rows["batch_total"].Cells[1].Value.ToInt32();
            _obj.entrant_id  = (fGrid.Rows["data_entrant"].Cells[1].AuxValue as fnn.iGComboItemEX).ID;
            _obj.sab_fs_id   = m_sabbath.fs_id;

            using (var xd = new xing())
            {
                var _ret_val = xd.SingleInsertCommandIgnore("off_batch_no_settings_tb",
                                                            new string[]
                {
                    "batch_no",
                    "batch_count",
                    "fs_time_stamp",
                    "batch_total",
                    "entrant_id",
                    "lch_id",
                    "sab_fs_id"
                }, new object[]
                {
                    _obj.batch_no,
                    _obj.batch_count,
                    0,
                    _obj.batch_total,
                    _obj.entrant_id,
                    datam.LCH_ID,
                    _obj.sab_fs_id
                });
                if (_ret_val == 0)
                {
                    MessageBox.Show("You Have Already Entered This BATCH NUMBER", "DUPLICATE BATCH NO", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    fGrid.Focus();
                    fGrid.SetCurCell("batch_no", 1);
                    fGrid.Rows["batch_no"].Cells[1].Value = null;
                    return;
                }
                xd.CommitTransaction();
            }
            (this.Owner as BatchNoManager).CheckForUpdates();
            ClearGrid();
        }
        private void buttonsave_Click(object sender, EventArgs e)
        {
            string _str = "Are You Sure You Want To Transfer The Selected Member ??";

            if (!dbm.WarningMessage(_str, "Transfer Warning"))
            {
                return;
            }
            ic.transferC _tc = new MTOMS.ic.transferC();
            _tc.church_name = fnn.GetIGridCellValue(fGrid, "church", "desc");
            if (fGrid.Rows["church"].Cells["desc"].AuxValue != null)
            {
                xso.ic.cregion _r = (fGrid.Rows["church"].Cells["desc"].AuxValue as fnn.iGComboItemEX).Tag as xso.ic.cregion;
                _tc.church_id   = _r.item_id;
                _tc.church_name = _r.item_name;
            }
            string[] _cols = new string[]
            {
                "mem_id",
                "cat_id",
                "reason",
                "comment",
                "transfer_date",
                "transfer_fs_id",
                "nchurch_name",
                "church_id",
                "edate",
                "pc_us_id",
                "exp_type",
                "lch_id",
                "lch_type_id"
            };
            object[] _row = new object[]
            {
                _tc.mem_id = mem_obj.mem_id,
                0,
                _tc.reason         = fnn.GetIGridCellValue(fGrid, "reason", "desc"),
                _tc.comment        = fnn.GetIGridCellValue(fGrid, "comment", "desc"),
                _tc.transfer_date  = Convert.ToDateTime(fGrid.Rows["transfer_date"].Cells["desc"].AuxValue),
                _tc.transfer_fs_id = fn.GetFSID(_tc.transfer_date),
                _tc.church_name,
                _tc.church_id,
                datam.CURR_DATE,
                datam.PC_US_ID,
                emm.export_type.insert.ToByte(),
                _tc.lch_id      = datam.LCH_ID,
                _tc.lch_type_id = datam.LCH_TYPE_ID
            };
            using (xing xd = new xing())
            {
                _tc.un_id = xd.SingleInsertCommandInt("transfer_tb", _cols, _row);
                xd.InsertUpdateDelete(string.Format("update member_tb set mem_status_type_id={0},{1},pc_us_id={2} where mem_id={3}", em.xmem_status.Transfered.ToByte(), dbm.ETS, datam.PC_US_ID, mem_obj.mem_id));
                xd.CommitTransaction();
            }
            datam.DATA_TRANSFER.Add(_tc.un_id, _tc);
            mem_obj.mem_status_id = em.xmem_status.Transfered.ToByte();
            mem_obj.objTransfer   = _tc;
            this.Close();
        }
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var _xd = new xing())
     {
         datam.fill_accounts(_xd);
         _xd.CommitTransaction();
     }
 }
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var xd = new xing())
     {
         datam.InitBankReconciliation(xd);
         xd.CommitTransaction();
     }
 }
 private void timer1_Tick(object sender, EventArgs e)
 {
     timer1.Enabled = false;
     clear_grids();
     datam.ShowWaitForm("Loading Data, Please Wait");
     Application.DoEvents();
     using (var xd = new xing())
     {
         if (m_account_start_date != null && _fs_id_1 <= fn.GetFSID(m_account_start_date.Value))
         {
             m_BF = m_opening_balance;
             //if (_fs_id_1 == fn.GetFSID(m_account_start_date.Value))
             //{
             //    m_BF = accn.GetFs_AccountBalance(xd, fn.GetFSID(dateTimePicker1.Value), m_account.account_id);
             //}
             //else
             //{
             //    m_BF = 0;
             //}
         }
         else
         {
             m_BF = accn.GetFs_AccountBalance(xd, fn.GetFSID(dateTimePicker1.Value.AddDays(-1)), m_account.account_id);
         }
         if (accn.DATA_ASSET_LIABILITY_STATEMENT == null)
         {
             accn.DATA_ASSET_LIABILITY_STATEMENT = new List <ic.account_AL_statementC>();
         }
         if (m_account.account_type == em.account_typeS.ActualAccount)
         {
             iGrid1.Cols["account"].Visible = false;
             accn.DATA_ASSET_LIABILITY_STATEMENT.Clear();
             m_account_name = string.Empty;
             accn.Get_AssetLiabilityAccountStatement(xd, _fs_id_1, _fs_id_2, m_account.account_id, string.Empty);
         }
         else
         {
             iGrid1.Cols["account"].Visible = true;
             var _accounts = accn.GetChildAccounts(m_account.account_id, em.account_typeS.ActualAccount);
             accn.DATA_ASSET_LIABILITY_STATEMENT.Clear();
             foreach (var _acc in _accounts)
             {
                 m_account_name = _acc.account_name;
                 accn.Get_AssetLiabilityAccountStatement(xd, _fs_id_1, _fs_id_2, _acc.account_id, m_account_name);
             }
         }
         xd.CommitTransaction();
     }
     LoadGrid();
     datam.HideWaitForm();
     if (!dateTimePicker1.Enabled)
     {
         dateTimePicker1.Enabled = true;
     }
     buttonrefresh.Enabled = true;
 }
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var xd = new xing())
     {
         datam.GetAccountsPayable(xd);
         m_LastStamp = wdata.TABLE_STAMP["accounts_current_balance_tb"];
         xd.CommitTransaction();
     }
 }
 private void backworker1_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var xd = new xing())
     {
         m_opening_balance    = fnn.GetAccountOpeningBalance(xd, m_account.account_id);
         m_account_start_date = fnn.GetAccountStartDate(xd, m_account.account_id);
         xd.CommitTransaction();
     }
 }
Exemplo n.º 18
0
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var _xd = new xing())
     {
         datam.GetDepartments(_xd);
         datam.InitExpenses(_xd);
         _xd.CommitTransaction();
     }
 }
Exemplo n.º 19
0
 private void BtnRefresh_Click(object sender, EventArgs e)
 {
     using (var _xd = new xing())
     {
         datam.GetDepartments(_xd);
         datam.InitExpenses(_xd);
         _xd.CommitTransaction();
     }
     UpdateGridWithDBChanges();
 }
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var xd = new xing())
     {
         datam.InitExpenses(xd);
         datam.GetBankAccounts(xd);
         datam.UpdateWithDrawnCheque(m_WithDraw);
         m_Expenses = datam.GetChequeExpenses(xd, m_WithDraw.wdr_id);
         xd.CommitTransaction();
     }
 }
Exemplo n.º 21
0
 private void buttonsave_Click(object sender, EventArgs e)
 {
     if (!IsOkay())
     {
         return;
     }
     using (var xd = new xing())
     {
         var ret_val = xd.ExecuteScalerInt(new string[] { "exp_acc_name" }, string.Format("select count(exp_acc_id) as cnt from acc_expense_accounts_tb where lower(exp_acc_name)=@exp_acc_name"), new object[] { fGrid.Rows["account"].Cells["desc"].Text.Trim().ToLower() });
         if (ret_val > 0)
         {
             MessageBox.Show("You Have Already Entered This Expense Account", "Duplicate Item Entry");
             return;
         }
         xd.CommitTransaction();
     }
     if (!dbm.WarningMessage("Are You Sure You Want To Create This Expense Account ??", "Save Warning"))
     {
         return;
     }
     ic.expense_accountC _exp = new ic.expense_accountC();
     _exp.exp_acc_status = em.exp_acc_statusS.valid;
     _exp.exp_acc_name   = fGrid.Rows["account"].Cells["desc"].Text.ToProperCase();
     _exp.exp_acc_type   = em.exp_acc_typeS.user_defined;
     if (fGrid.Rows["item_cat"].Cells["desc"].AuxValue != null)
     {
         var _cat = (fGrid.Rows["item_cat"].Cells["desc"].AuxValue as fnn.iGComboItemEX).Tag as ic.expense_catC;
         _exp.exp_cat_id  = _cat.exp_cat_id;
         _exp.objCategory = _cat;
     }
     if (fGrid.Rows["department"].Cells["desc"].AuxValue != null)
     {
         var _dept = ((fGrid.Rows["department"].Cells["desc"].AuxValue as fnn.iGComboItemEX).Tag as ic.departmentC);
         _exp.dept_id             = _dept.dept_id;
         _exp.dept_parent_id      = _dept.parent_id;
         _exp.dept_sys_account_id = _dept.expense_sys_account_id;
         _exp.objDepartment       = _dept;
     }
     using (var xd = new xing())
     {
         accn.CreateExpenseAccount(_exp, xd);
         xd.CommitTransaction();
     }
     sdata.ClearFormCache(em.fm.chart_of_accounts.ToInt16());
     if (this.Owner is ExpensesManager)
     {
         (this.Owner as ExpensesManager).CreateNewRow(_exp, true);
     }
     this.Tag = 1;
     buttoncancel.PerformClick();
 }
        private void buttonsave_Click(object sender, EventArgs e)
        {
            string _str = "Are You Sure You Want To Carry Out This Operation ??";

            if (!dbm.WarningMessage(_str, "Apostacy Warning"))
            {
                return;
            }
            ic.apostacyC _tc   = new MTOMS.ic.apostacyC();
            string[]     _cols = new string[]
            {
                "mem_id",
                "apos_date",
                "apos_fs_id",
                "cat_id",
                "reason",
                "comment",
                "edate",
                "exp_type",
                "pc_us_id",
                "lch_id",
                "lch_type_id",
                "fs_time_stamp"
            };
            object[] _row = new object[]
            {
                _tc.mem_id         = mem_obj.mem_id,
                _tc.apostacy_date  = Convert.ToDateTime(fGrid.Rows["apostacy_date"].Cells["desc"].AuxValue),
                _tc.apostacy_fs_id = fn.GetFSID(_tc.apostacy_date),
                0,
                _tc.reason  = fnn.GetIGridCellValue(fGrid, "reason", "desc"),
                _tc.comment = fnn.GetIGridCellValue(fGrid, "comment", "desc"),
                datam.CURR_DATE,
                emm.export_type.insert.ToByte(),
                datam.PC_US_ID,
                _tc.lch_id      = datam.LCH_ID,
                _tc.lch_type_id = datam.LCH_TYPE_ID,
                0//fs_time_stamp
            };
            using (xing xd = new xing())
            {
                _tc.un_id = xd.SingleInsertCommandTSPInt("apostacy_tb", _cols, _row);
                xd.InsertUpdateDelete(string.Format("update member_tb set mem_status_type_id={0},{1},pc_us_id={2} where mem_id={3}", em.xmem_status.Apostacy.ToByte(), dbm.ETS, datam.PC_US_ID, mem_obj.mem_id));
                xd.CommitTransaction();
            }
            datam.DATA_APOSTACY.Add(_tc.un_id, _tc);
            mem_obj.mem_status_id = em.xmem_status.Apostacy.ToByte();
            mem_obj.objApostacy   = _tc;
            this.Close();
        }
Exemplo n.º 23
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     using (var xd = new xing())
     {
         datam.fill_church_group_types(xd);
         xd.CommitTransaction();
     }
     comboBoxEx1.SelectedIndex = -1;
     comboBoxEx1.Items.Clear();
     foreach (var k in datam.DATA_CG_TYPES.Values)
     {
         comboBoxEx1.Items.Add(k);
     }
 }
        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {
            string _str = "Are You Sure You Want To Delete This Entry";

            if (!dbm.WarningMessage(_str, "Delete Entry Warning"))
            {
                return;
            }
            var m_partition = string.Format("{0}{1}", m_YEAR, m_MONTH).ToInt32();
            var _obj        = fGrid.SelectedRows[0].Tag as ic.bank_reconc_transC;

            if (_obj != null)
            {
                using (var xd = new xing())
                {
                    long _trans_id = xd.ExecuteScalarInt64(string.Format("select transaction_id from acc_foreign_exchange_tb where un_id={0} and status={1}", _obj.un_id, em.voucher_statusS.valid.ToByte()));
                    if (_trans_id > 0)
                    {
                        accn.DeleteJournal(_trans_id, xd);
                        //
                        xd.SingleUpdateCommandALL("acc_bank_reconc_trans_tb",
                                                  new string[]
                        {
                            "status",
                            "un_id",
                        }, new object[]
                        {
                            em.voucher_statusS.cancelled.ToByte(),
                            _obj.un_id
                        }, 1);
                        //
                        //fnn.ExecuteDeleteBase(xd, new ic.deleteBaseC()
                        //{
                        //    del_fs_date = sdata.CURR_DATE,
                        //    del_fs_id = sdata.CURR_FS.fs_id,
                        //    del_fs_time = DateTime.Now.ToShortTimeString(),
                        //    del_pc_us_id = sdata.PC_US_ID
                        //}, "acc_foreign_exchange_tb", "un_id", _obj.un_id);
                        //
                        xd.CommitTransaction();
                        fGrid.Rows.RemoveAt(fGrid.Rows[_obj.un_id.ToString()].Index);
                    }
                    else
                    {
                        MessageBox.Show("This Record Has Already Been Cancelled", "Cancel Failure");
                    }
                }
                CheckForUpdates();
            }
        }
Exemplo n.º 25
0
        private void buttonsave_Click(object sender, EventArgs e)
        {
            string _str = "Are You Sure You Want To Proceed With This Operation ??";

            if (!dbm.WarningMessage(_str, "Death Transfer Warning"))
            {
                return;
            }
            ic.deathC _tc = new MTOMS.ic.deathC();

            string[] _cols = new string[]
            {
                "mem_id",
                "cat_id",
                "death_cause",
                "comment",
                "death_date",
                "death_fs_id",
                "edate",
                "pc_us_id",
                "exp_type",
                "lch_id",
                "lch_type_id"
            };
            object[] _row = new object[]
            {
                _tc.mem_id = mem_obj.mem_id,
                0,
                _tc.reason      = fnn.GetIGridCellValue(fGrid, "cause", "desc"),
                _tc.comment     = fnn.GetIGridCellValue(fGrid, "comment", "desc"),
                _tc.death_date  = Convert.ToDateTime(fGrid.Rows["death_date"].Cells["desc"].AuxValue),
                _tc.death_fs_id = fn.GetFSID(_tc.death_date),
                datam.CURR_DATE,
                datam.PC_US_ID,
                emm.export_type.insert.ToByte(),
                _tc.lch_id      = datam.LCH_ID,
                _tc.lch_type_id = datam.LCH_TYPE_ID
            };
            using (xing xd = new xing())
            {
                _tc.un_id = xd.SingleInsertCommandInt("death_tb", _cols, _row);
                xd.InsertUpdateDelete(string.Format("update member_tb set mem_status_type_id={0},{1},pc_us_id={2} where mem_id={3}", em.xmem_status.Deceased.ToByte(), dbm.ETS, datam.PC_US_ID, mem_obj.mem_id));
                xd.CommitTransaction();
            }
            datam.DATA_DEATH.Add(_tc.un_id, _tc);
            mem_obj.mem_status_id = em.xmem_status.Deceased.ToByte();
            mem_obj.objDeath      = _tc;
            this.Close();
        }
Exemplo n.º 26
0
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     if (!IsLoaded)
     {
         datam.SystemInitializer();
     }
     else
     {
         using (var xd = new xing())
         {
             datam.fill_batch_no_sabbath(xd, m_sabbath.fs_id);
             xd.CommitTransaction();
         }
     }
 }
Exemplo n.º 27
0
 private void ChurchGroupMaker_Load(object sender, EventArgs e)
 {
     CenterToScreen();
     this.FormClosing += ChurchGroupMaker_FormClosing;
     using (var xd = new xing())
     {
         datam.fill_church_group_types(xd);
         datam.fill_church_groups(xd);
         xd.CommitTransaction();
     }
     foreach (var k in datam.DATA_CG_TYPES.Values)
     {
         comboBoxEx1.Items.Add(k);
     }
 }
Exemplo n.º 28
0
        private void ts_delete_Click(object sender, EventArgs e)
        {
            using (var _fm = new SdaHelperManager.ConfirmWPwd())
            {
                _fm.ShowDialog();
                if (_fm.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            string _str = "Are You Sure You Want To Delete The Expense Account ??";
            iGRow  _row = fGrid.SelectedRows[0];
            var    _obj = fGrid.SelectedRows[0].Tag as ic.expense_accountC;

            if (_obj == null)
            {
                return;
            }
            if (dbm.ExecuteScalarInt(string.Format("select TOP 1 exp_acc_id from acc_expense_trans_tb where exp_acc_id={0}", _obj.exp_acc_id)) > 0)
            {
                MessageBox.Show("Cannot Delete This Expense Account Since Has Important Attachements To Other Records Already", "Delete Failure");
                return;
            }
            if (!dbm.WarningMessage(_str, "Delete Warning"))
            {
                return;
            }
            using (var xd = new xing())
            {
                xd.SingleDeleteCommandExp("acc_expense_accounts_tb", new string[]
                {
                    "exp_acc_id", "lch_id"
                }, new int[] { _obj.exp_acc_id, datam.LCH_ID });

                _row.Tag = null;
                fGrid.Rows.RemoveAt(_row.Index);
                datam.DATA_EXPENSE_ACCOUNTS.Remove(_obj.exp_acc_id);
                //
                xd.SingleDeleteCommandExp("accounts_tb", new string[]
                {
                    "account_id",
                }, new int[] { _obj.sys_account_id });
                //
                datam.DATA_ACCOUNTS.Remove(_obj.sys_account_id);
                xd.CommitTransaction();
                sdata.ClearFormCache(em.fm.chart_of_accounts.ToInt16());
            }
        }
        private void toolStripSetAsDefault_Click(object sender, EventArgs e)
        {
            var _row     = fGrid.SelectedRows[0];
            var _cg_type = _row.Tag as ic.church_group_typeC;

            if (_cg_type != null)
            {
                using (var _xd = new xing())
                {
                    var _prev_default_type = datam.DATA_CG_TYPES.Values.FirstOrDefault(j => j.is_default);
                    if (_prev_default_type != null)
                    {
                        _prev_default_type.is_default = false;
                        //
                        _xd.SingleUpdateCommandALL("church_group_types_tb", new string[]
                        {
                            "is_default",
                            "cg_type_id"
                        }, new object[]
                        {
                            _prev_default_type.is_default.ToBooleanByte(),
                            _prev_default_type.cg_type_id
                        }, 1);

                        datam.DATA_CG_TYPES[_prev_default_type.cg_type_id].is_default = false;
                        fGrid.Rows[string.Format("gp-{0}", _prev_default_type.cg_type_id)].RowTextCell.Value = _prev_default_type.cg_type_name;
                    }
                    _cg_type.is_default = true;
                    _xd.SingleUpdateCommandALL("church_group_types_tb", new string[]
                    {
                        "is_default",
                        "cg_type_id"
                    }, new object[]
                    {
                        _cg_type.is_default.ToBooleanByte(),
                        _cg_type.cg_type_id
                    }, 1);
                    //
                    datam.DATA_CG_TYPES[_cg_type.cg_type_id].is_default = true;
                    _row.RowTextCell.Value = string.Format("{0} (Default)", _cg_type.cg_type_name);
                    _xd.CommitTransaction();
                }

                sdata.ClearFormCache(em.fm.membershi.ToInt16());
                sdata.ClearFormCache(em.fm.view_church_members.ToInt16());
            }
        }
Exemplo n.º 30
0
        public static void SystemInitializer()
        {
            if (is_init)
            {
                return;
            }
            try
            {
                is_init = true;
                if (CURR_FS == null)
                {
                    CURR_DATE = fn.GetServerDate();
                    CURR_FS   = fn.GetFsDetails(CURR_DATE, false);
                }
                if (CURR_FS != null)
                {
                    fill_data_fs(CURR_FS.fs_year);
                }
                if (DATA_SABBATH_RECEIPT == null)
                {
                    DATA_SABBATH_RECEIPT = new SortedList <int, List <MTOMS.ic.off_receipt> >();
                }
                DATA_STAMP_STORE = new SortedList <em.StampTables, long>();
                GetLastSabbath();
                FillPcUserDetails();


                xing xd = new xing();
                datam.FillChurchSubUnits(xd);
                datam.MemberInit(ref xd);
                fill_church_group_types(xd);
                fill_church_groups(xd);
                datam.InitDesignation(xd);
                datam.MemberStatusInit(ref xd);
                datam.InitAccount(xd);
                datam.InitExpenses(xd);
                datam.DepartmentInit(ref xd);
                datam.GetSystemDefaultValues(xd);
                xd.CommitTransaction();
                xd.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                System.Environment.Exit(0);
            }
        }