private void InsertToOldTable()
        {
            OldTuitionManager oldManage = new OldTuitionManager();

            SetOldData();
            oldManage.SaveOldTuition(myOldTuition);
        }
        private void DeleteOld()
        {
            var otherManage = new OtherFeesManager();
            var oldManage   = new OldTuitionManager();
            var result      = MessageBox.Show("Do you want to delete this record?", "Are you sure?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                if (gridOld[gridOld.RowSel, 2].ToString() == "Tuition Fee")
                {
                    oldManage.DeleteOld(selectedOldId);
                }
                else
                {
                    otherManage.DeleteOther(selectedOldId);
                }
            }
        }
        private void UpdateOldBalance()
        {
            using (EditOld editOld = new EditOld())
            {
                editOld.txtDescription.text = gridOld[gridOld.RowSel, 2].ToString();
                editOld.txtAmount.text      = gridOld[gridOld.RowSel, 3].ToString();
                editOld.txtBalance.text     = gridOld[gridOld.RowSel, 4].ToString();
                editOld.txtPaymade.text     = gridOld[gridOld.RowSel, 5].ToString();
                string comp = gridOld[gridOld.RowSel, 6].ToString();
                if (comp == "false")
                {
                    editOld.cmbStatus.selectedIndex = 1;
                    editOld.calDatePaid.Enabled     = false;
                }
                else
                {
                    editOld.calDatePaid.Value       = DateTime.Parse(gridOld[gridOld.RowSel, 7].ToString());
                    editOld.cmbStatus.selectedIndex = 0;
                    editOld.calDatePaid.Enabled     = true;
                }
                editOld.ShowDialog();
                if (editOld.isConfirmed == true)
                {
                    if (gridOld[gridOld.RowSel, 2].ToString() == "Tuition Fee")
                    {
                        var oldManage = new OldTuitionManager();
                        var item      = new OldTuitionItem();

                        item.OldTuition_Description = editOld.txtDescription.text;
                        item.OldTuition_Amount      = Decimal.Parse(editOld.txtAmount.text);
                        item.OldTuition_Balance     = Decimal.Parse(editOld.txtBalance.text);
                        item.OldTuition_PayMade     = Decimal.Parse(editOld.txtPaymade.text);
                        item.OldTuition_Id          = selectedOldId;
                        if (editOld.cmbStatus.selectedIndex == 0)
                        {
                            item.OldTuition_Status   = "true";
                            item.OldTuition_DatePaid = editOld.calDatePaid.Value.ToString("MM/dd/yyyy");
                        }
                        else
                        {
                            item.OldTuition_Status   = "false";
                            item.OldTuition_DatePaid = "N/A";
                        }

                        oldManage.UpdatOld(item);
                    }
                    else
                    {
                        var oldOtherManage = new OtherFeesManager();
                        var item           = new OtherFeesItem();

                        item.OtherFees_Description = editOld.txtDescription.text;
                        item.OtherFees_Amount      = Decimal.Parse(editOld.txtAmount.text);
                        item.OtherFees_Balance     = Decimal.Parse(editOld.txtBalance.text);
                        item.OtherFees_PaymentMade = Decimal.Parse(editOld.txtPaymade.text);
                        item.OtherFees_Id          = selectedOldId;
                        if (editOld.cmbStatus.selectedIndex == 0)
                        {
                            item.OtherFees_Status   = "true";
                            item.OtherFees_DatePaid = editOld.calDatePaid.Value.ToString("MM/dd/yyyy");
                        }
                        else
                        {
                            item.OtherFees_Status   = "false";
                            item.OtherFees_DatePaid = "N/A";
                        }

                        oldOtherManage.UpdateOldOther(item);
                    }
                }
            }
            StdClick();
        }
Ejemplo n.º 4
0
        public void UpdateOldOtherBalance()
        {
            OldTuitionManager oldManage = new OldTuitionManager();

            oldManage.UpdateOldOtherBalance(balanceDiff, payMadeSum, selectedOldId);
        }