예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["action"] != null)
        {
            if (Request.QueryString["action"] == "deleteItem")
            {
                try
                {
                    int id = Convert.ToInt32(Request.QueryString["id"]);
                    FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter tempTran = new FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter();
                    tempTran.DeleteTempTransactionEntry(id);
                    Response.Redirect("~/pages/finance/finhome.aspx?panel=Journal&action=" + System.Guid.NewGuid().ToString());
                }
                catch (Exception ex) { }
                loadAccItems();
                VchPanel.Visible        = true;
                VchTypeSelPanel.Visible = false;
            }
            else if (Request.QueryString["action"] == "addItem")
            {
                VchTypeSelPanel.Visible = false;
            }
        }

        else
        {
            VchPanel.Visible        = false;
            VchTypeSelPanel.Visible = true;
            if (IsPostBack == false)
            {
                MySessionManager.TempTranKey = System.Guid.NewGuid().ToString();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["action"] != null)
        {
            if (Request.QueryString["action"] == "deleteItem")
            {
                try
                {
                    int id = Convert.ToInt32(Request.QueryString["id"]);
                    FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter tempTran = new FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter();
                    tempTran.DeleteTempTransactionEntry(id);
                    Response.Redirect("~/pages/finance/finhome.aspx?panel=Journal&action=" + System.Guid.NewGuid().ToString());
                }
                catch (Exception ex) { }
                loadAccItems();
                VchPanel.Visible = true;
                VchTypeSelPanel.Visible = false;
            }
            else if (Request.QueryString["action"] == "addItem")
            {
                VchTypeSelPanel.Visible = false;
            }
        }

        else
        {
            VchPanel.Visible = false;
            VchTypeSelPanel.Visible = true;
            if (IsPostBack == false)
            {
                MySessionManager.TempTranKey = System.Guid.NewGuid().ToString();
            }
        }

    }
예제 #3
0
    protected void deleteItem_Click(object sender, EventArgs e)
    {
        try
        {
            LinkButton link = (LinkButton)sender;

            int id = Convert.ToInt32(link.CommandArgument);
            FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter tempTran = new FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter();
            tempTran.DeleteTempTransactionEntry(id);
            gvTranEntries.DataBind();
            FinancialDSTableAdapters.GetTempEntriesTotalsTableAdapter getTotal = new FinancialDSTableAdapters.GetTempEntriesTotalsTableAdapter();
            FinancialDS.GetTempEntriesTotalsDataTable totEntries = getTotal.GetData(MySessionManager.TempTranKey);

            lblDebitTotal.Text  = Convert.ToString(totEntries[0].TotalDebit);
            lblCreditTotal.Text = Convert.ToString(totEntries[0].TotalCredit);
        }
        catch (Exception ex) { }
        loadAccItems();
        VchPanel.Visible        = true;
        VchTypeSelPanel.Visible = false;
    }
    protected void deleteItem_Click(object sender, EventArgs e)
    {
        try
        {
            LinkButton link = (LinkButton)sender;

            int id = Convert.ToInt32(link.CommandArgument);
            FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter tempTran = new FinancialDSTableAdapters.tempTransaction_EntriesTableAdapter();
            tempTran.DeleteTempTransactionEntry(id);
            gvTranEntries.DataBind();
            FinancialDSTableAdapters.GetTempEntriesTotalsTableAdapter getTotal = new FinancialDSTableAdapters.GetTempEntriesTotalsTableAdapter();
            FinancialDS.GetTempEntriesTotalsDataTable totEntries = getTotal.GetData(MySessionManager.TempTranKey);

            lblTotal.Text = Convert.ToString(totEntries[0].TotalAmount);
        }
        catch (Exception ex) { }
        loadAccItems();
        transactionsPanel.Visible = true;
        VchPanel.Visible = true;
        VchTypeSelPanel.Visible = false;
    }