Exemplo n.º 1
0
 private void Update_Spouse(xing xd, ic.memberC mem_obj)
 {
     ic.spouseC objSpouse = mem_obj.objSpouse;
     string[]   tb_col    = null;
     object[]   _row      = null;
     tb_col = new string[]
     {
         "mem_id",
         "spouse_id",
         "spouse_name",
         "phone_no",
         "marriage_year",
         "marriage_date",
         "marriage_fs_id",
         "couple_id",
         "pastor_name",
         "church_name",
         "church_id", "un_id"
     };
     _row = new object[]
     {
         objSpouse.mem_id,
         objSpouse.spouse_id,
         objSpouse.spouse_name,
         objSpouse.phone_no,
         objSpouse.marriage_year,
         objSpouse.marriage_date,
         objSpouse.marriage_fs_id,
         objSpouse.couple_id,
         objSpouse.pastor,
         objSpouse.church,
         0, objSpouse.un_id
     };
     xd.SingleUpdateCommandALL("ng_spouse_tb", tb_col, _row, 1);
 }
Exemplo n.º 2
0
        private static void Get_BankingWithDrawStatement(xing xd, int start_fs_id, int end_fs_id, int account_id)
        {
            string _str = string.Format("select * from acc_bank_withdraw_tb  where fs_id between {0} and {1} and bank_account_id={2} and status=0", start_fs_id, end_fs_id, account_id);

            ic.account_AL_statementC _obj = null;
            using (var _dr = xd.SelectCommand(_str))
            {
                while (_dr.Read())
                {
                    _obj           = new ic.account_AL_statementC();
                    _obj.cr_amount = _dr["w_amount"].ToInt32();
                    if (_dr["cheque_alias"] != null)
                    {
                        _obj.description = string.Format("WithDraw {0}", _dr["cheque_alias"].ToString());
                    }
                    else
                    {
                        _obj.description = string.Format("Cheque WithDraw");
                    }
                    _obj.fs_date        = _dr.GetDateTime("fs_date");
                    _obj.fs_id          = _dr["fs_id"].ToInt32();
                    _obj.reference_no   = string.Format("{0}", _dr["cheque_no"].ToString());
                    _obj.reference_type = em.account_AL_referenceTypeS.cheque;
                    _obj.statement_type = em.account_statement_typeS.bank_withdraw;
                    _obj.record_id      = _dr["wdr_id"].ToInt32();
                    accn.DATA_ASSET_LIABILITY_STATEMENT.Add(_obj);
                }
            }
        }
        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.º 4
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;
            }
            }
        }
Exemplo n.º 5
0
        private static void Get_OffAccountsStatement(xing xd, int start_fs_id, int end_fs_id, int account_id, int cg_id, string _account_name)
        {
            string _str = null;

            if (cg_id < 0)
            {
                _str = string.Format("select m.amount,m.fs_id,m.fs_date,c.source_name,c.off_id from off_accounts_tb as m,off_main_tb as c where m.fs_id between {0} and {1} and m.account_id={2} and m.off_id=c.off_id and m.receipt_status=1", start_fs_id, end_fs_id, account_id);
            }
            else
            {
                _str = string.Format("select m.amount,m.fs_id,m.fs_date,c.source_name,c.off_id from off_accounts_tb as m,off_main_tb as c where m.fs_id between {0} and {1} and m.account_id={2} and m.cg_id={3} and m.off_id=c.off_id and m.receipt_status=1", start_fs_id, end_fs_id, account_id, cg_id);
            }
            ic.account_AL_statementC _obj = null;
            using (var _dr = xd.SelectCommand(_str))
            {
                while (_dr.Read())
                {
                    _obj                = new ic.account_AL_statementC();
                    _obj.dr_amount      = _dr["amount"].ToInt32();
                    _obj.description    = _dr["source_name"].ToStringNullable();
                    _obj.fs_date        = _dr.GetDateTime("fs_date");
                    _obj.fs_id          = _dr["fs_id"].ToInt32();
                    _obj.reference_no   = string.Format("R-{0}", _dr["off_id"].ToInt32());
                    _obj.reference_type = em.account_AL_referenceTypeS.receipt;
                    _obj.statement_type = em.account_statement_typeS.income_offering;
                    _obj.account_name   = _account_name;
                    accn.DATA_ASSET_LIABILITY_STATEMENT.Add(_obj);
                }
            }
        }
        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 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 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 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();
             }
         }
     }
 }
        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.º 11
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 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;
            }
            }
        }
 private void CheckForUpdates()
 {
     if (m_YEAR > 0)
     {
         using (var xd = new xing())
         {
             if (datam.GetYearExpenses(m_YEAR, xd))
             {
                 if (tab1_loaded)
                 {
                     tab1_loaded = false;
                 }
                 if (tab2_loaded)
                 {
                     tab2_loaded = false;
                 }
                 LoadTabs();
             }
             else
             {
                 if (tab1_loaded)
                 {
                     fGrid.Focus();
                     return;
                 }
                 if (tab2_loaded)
                 {
                     fGridnormal.Focus();
                     return;
                 }
             }
         }
     }
 }
Exemplo n.º 14
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;
                    }
                }
            }
        }
Exemplo n.º 15
0
        private void SaveCouple(xing xd, ic.coupleC _couple)
        {
            var tb_col = new string[]
            { "couple_name",
              "male_mem_id",
              "female_mem_id",
              "is_valid",
              "exp_type",
              "pc_us_id",
              "pc_us_name",
              "edate",
              "lch_id",
              "lch_type_id",
              "fs_time_stamp" };

            _couple.is_valid = true;
            var _row = new object[]
            {
                _couple.couple_name,
                _couple.male_mem_id,
                _couple.female_mem_id,
                1,
                emm.export_type.insert.ToByte(),
                datam.PC_US_ID,
                datam.PC_US_NAME,
                datam.CURR_DATE,
                _couple.lch_id      = datam.LCH_ID,
                _couple.lch_type_id = datam.LCH_TYPE_ID,
                0   //fs_time_stamp
            };

            _couple.couple_id = xd.SingleInsertCommandTSPInt("couple_tb", tb_col, _row);
            datam.DATA_COUPLE.Add(_couple.couple_id, _couple);
        }
Exemplo n.º 16
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();
        }
Exemplo n.º 17
0
        public static List <ic.expense_transC> GetExpensesByID(xing xd, int _exp_account_id, int _fs_id_1, int _fs_id_2)
        {
            List <ic.expense_transC> _list = new List <ic.expense_transC>();
            string _str = null;

            _str = string.Format("select * from acc_expense_trans_tb where sys_account_id={0} and exp_fs_id between {1} and {2} and voucher_status={3}", _exp_account_id, _fs_id_1, _fs_id_2, em.voucher_statusS.valid.ToByte());
            using (var _dr = xd.SelectCommand(_str))
            {
                if (_dr == null)
                {
                    return(null);
                }
                ic.expense_transC _obj = null;
                while (_dr.Read())
                {
                    _obj                   = new ic.expense_transC();
                    _obj.un_id             = _dr["un_id"].ToInt32();
                    _obj.voucher_no        = _dr["voucher_no"].ToStringNullable();
                    _obj.voucher_id        = _dr["voucher_id"].ToInt32();
                    _obj.exp_acc_id        = _dr["exp_acc_id"].ToInt32();
                    _obj.exp_amount        = _dr["exp_amount"].ToInt32();
                    _obj.exp_details       = _dr["exp_details"].ToStringNullable();
                    _obj.exp_date          = _dr.GetDateTime("exp_date");
                    _obj.exp_fs_id         = _dr["exp_fs_id"].ToInt32();
                    _obj.pc_us_id          = _dr["pc_us_id"].ToInt32();
                    _obj.exp_cat_id        = _dr["exp_cat_id"].ToInt32();
                    _obj.dept_id           = _dr["dept_id"].ToInt32();
                    _obj.dept_parent_id    = _dr["dept_parent_id"].ToInt32();
                    _obj.pay_mode          = (em.voucher_Paymode)_dr["pay_mode"].ToByte();
                    _obj.cheque_no         = _dr["cheque_no"].ToStringNullable();
                    _obj.source_type       = (em.exp_inc_src_typeS)_dr["source_type_id"].ToByte();
                    _obj.source_account_id = _dr["source_account_id"].ToInt32();
                    _obj.sys_account_id    = _dr["sys_account_id"].ToInt32();
                    _obj.source_id         = _dr["source_id"].ToInt32();
                    if (_dr["w_dr_data"] != null)
                    {
                        _obj.w_dr_data = _dr["w_dr_data"].ToStringNullable();
                    }
                    if (_dr["tf_string"] != null)
                    {
                        _obj.tf_string = _dr["tf_string"].ToStringNullable();
                    }
                    //
                    try
                    {
                        _obj.objExpenseAccount = datam.DATA_EXPENSE_ACCOUNTS[_obj.exp_acc_id];
                    }
                    catch (Exception)
                    {
                    }
                    _obj.voucher_status = (em.voucher_statusS)_dr["voucher_status"].ToInt16();
                    _obj.received_by    = _dr["received_by"].ToStringNullable();
                    _obj.is_updated     = true;
                    _list.Add(_obj);
                    _obj = null;
                }
            }
            return(_list);
        }
        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.InitAccount(xd);
     }
 }
Exemplo n.º 20
0
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var xd = new xing())
     {
         datam.InitBankReconciliation(xd);
     }
 }
 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.GetPledgeSettings(xd);
         datam.GetCurrentPledges(xd);
     }
 }
 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.º 26
0
 private void BtnRefresh_Click(object sender, EventArgs e)
 {
     using (var _xd = new xing())
     {
         datam.GetDepartments(_xd);
         datam.InitExpenses(_xd);
         _xd.CommitTransaction();
     }
     UpdateGridWithDBChanges();
 }
Exemplo n.º 27
0
 private void backworker_DoWork(object sender, DoWorkEventArgs e)
 {
     datam.SystemInitializer();
     using (var _xd = new xing())
     {
         datam.GetDepartments(_xd);
         datam.InitExpenses(_xd);
         _xd.CommitTransaction();
     }
 }
 public static void GetMemberID(xing xd)
 {
     mem_id = xd.IDCtrlGet(mem_id_tb, 2012, 1001);
     if (mem_id == 666 || mem_id == 1000)
     {
         xd.IDCtrlDelete(mem_id_tb);
         mem_id = dbm.IDCtrlGet(mem_id_tb, 2012, 1001);
     }
     mem_code = fn.GetMemberCode(mem_id);
     mem_id   = (string.Format("{0}{1}", datam.LCH_ID, mem_id)).ToInt32();
 }
        private static bool Save_parent(xing xd, ic.memberC mem_obj)
        {
            if (xd == null)
            {
                return(false);
            }
            if (mem_obj == null)
            {
                return(false);
            }

            string[] tb_col = null;
            object[] _row   = null;

            tb_col = new string[]
            {
                "mem_id",
                "father_name",
                "father_phone",
                "father_status",
                "mother_name",
                "mother_phone",
                "mother_status",
                "guardian_name",
                "guardian_phone",
                "exp_type",
                "father_mem_id",
                "mother_mem_id",
                "guardian_mem_id",
                "lch_id",
                "lch_type_id"
            };
            _row = new object[]
            {
                mem_obj.mem_id,
                mem_obj.objParent.father_name,
                mem_obj.objParent.father_phone,
                mem_obj.objParent.father_status,
                mem_obj.objParent.mother_name,
                mem_obj.objParent.mother_phone,
                mem_obj.objParent.mother_status,
                mem_obj.objParent.guardian_name,
                mem_obj.objParent.guardian_phone,
                emm.export_type.insert.ToByte(),
                mem_obj.objParent.father_mem_id,
                mem_obj.objParent.mother_mem_id,
                mem_obj.objParent.guardian_mem_id,
                datam.LCH_ID,
                datam.LCH_TYPE_ID
            };
            xd.SingleInsertCommand("parents_tb", tb_col, _row);
            return(true);
        }
Exemplo n.º 30
0
 public static void InitBankReconciliation(xing xd)
 {
     if (datam.DATA_ENUM_BANK_RECONCILIATION_TYPES == null)
     {
         datam.DATA_ENUM_BANK_RECONCILIATION_TYPES = new SortedList <em.bank_reconc_typeS, string>();
         datam.DATA_ENUM_BANK_RECONCILIATION_TYPES.Add(em.bank_reconc_typeS.addition, "Addition");
         datam.DATA_ENUM_BANK_RECONCILIATION_TYPES.Add(em.bank_reconc_typeS.deduction, "Deduction");
         // datam.DATA_ENUM_BANK_RECONCILIATION_TYPES.Add(em.bank_reconc_account_typeS.transfer, "Transfer");
     }
     fill_Bank_Reconciliation_Accounts(xd);
     GetBankAccounts(xd);
 }