Esempio n. 1
0
    protected void InsertGeneralJournalEntry()
    {
        FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData();
        string tranStr = "";

        tranStr  = "DECLARE @new_entry_number DECIMAL\n";
        tranStr += "DECLARE @new_seq_number DECIMAL\n";
        tranStr += "SET @new_entry_number=(SELECT ISNULL(MAX(entry_no),0)+1 FROM general_journal_entry WHERE elt_account_number=" + elt_account_number + ")\n";
        tranStr += "SET @new_seq_number=(SELECT ISNULL(MAX(tran_seq_num),0)+1 FROM all_accounts_journal WHERE elt_account_number=" + elt_account_number + ")\n";
        tranStr += "INSERT INTO general_journal_entry(elt_account_number,entry_no,item_no,gl_account_number,credit,debit,memo,org_acct,dt)\n";
        tranStr += "VALUES(" + elt_account_number + ",@new_entry_number,1," + lstBanks.SelectedValue + ",0," + txtAmount.Text + ",N'" + txtMemo.Text + "'," + hVendorAcct.Value + ",GETDATE())\n";
        tranStr += "INSERT INTO general_journal_entry(elt_account_number,entry_no,item_no,gl_account_number,credit,debit,memo,org_acct,dt)\n";
        tranStr += "VALUES(" + elt_account_number + ",@new_entry_number,1," + lstRevenues.SelectedValue + "," + txtAmount.Text + ",0,N'" + txtMemo.Text + "'," + hVendorAcct.Value + ",GETDATE())\n";
        tranStr += "INSERT INTO all_accounts_journal(elt_account_number,tran_seq_num,gl_account_number,gl_account_name,tran_type,tran_num,tran_date,customer_name,customer_number,split,memo,debit_amount,credit_amount)\n";
        tranStr += "VALUES(" + elt_account_number + ",@new_seq_number," + lstBanks.SelectedValue + ",N'" + lstBanks.Items[lstBanks.SelectedIndex].Text + "','DEPOSIT',@new_entry_number,GETDATE(),N'" + lstVendorName.Text + "'," + hVendorAcct.Value + ",'',N'" + txtMemo.Text + "'," + txtAmount.Text + ",0)\n";
        tranStr += "INSERT INTO all_accounts_journal(elt_account_number,tran_seq_num,gl_account_number,gl_account_name,tran_type,tran_num,tran_date,customer_name,customer_number,split,memo,debit_amount,credit_amount)\n";
        tranStr += "VALUES(" + elt_account_number + ",@new_seq_number+1," + lstRevenues.SelectedValue + ",N'" + lstBanks.Items[lstRevenues.SelectedIndex].Text + "','DEPOSIT',@new_entry_number,GETDATE(),N'" + lstVendorName.Text + "'," + hVendorAcct.Value + ",'',N'" + txtMemo.Text + "',0," + txtAmount.Text + ")\n";

        if (!feData.DataTransaction(tranStr))
        {
            string errorStr = feData.GetLastTransactionError();
            string errorMsg = "Unexpected error occurred. " + errorStr;

            txtResultBox.Text    = errorMsg;
            txtResultBox.Visible = true;
        }
    }
Esempio n. 2
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string sqlTxt = sqlTxt = "DELETE FROM setup_master WHERE page_id=" + hPageId.Value;

        FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData();
        if (FEData.DataTransaction(sqlTxt))
        {
            Response.Redirect("/IFF_MAIN/SystemAdmin/SetupManager.aspx");
        }
    }
Esempio n. 3
0
    protected void btnDeleteAll_Click(object sender, EventArgs e)
    {
        string sqlStr = "DELETE FROM country_code WHERE elt_account_number=" + elt_account_number;

        FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData();
        FEData.DataTransaction(sqlStr);

        GridView1.DataBind();
        GridView2.DataBind();
        Initialize_Components();
    }
Esempio n. 4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData();
        if (hCostItem.Value != "" && hCostItem.Value != "0")
        {
            string tranStr = "";
            // Consolidated House Item
            if (txtHAWB.Text != "")
            {
                // Other Charge
                if (txtItem.Text != "")
                {
                    tranStr = "UPDATE hawb_other_charge SET cost_desc=N'" + lstCostItem.Text
                              + "',cost_code=" + hCostItem.Value + ",cost_amt=" + txtCostAmt.Text
                              + " WHERE elt_account_number=" + elt_account_number + " AND hawb_num=N'" + txtHAWB.Text
                              + "' AND tran_no=" + txtItem.Text;
                }
                // Weight Charge
                else
                {
                    tranStr = "UPDATE hawb_weight_charge SET cost_desc=N'" + lstCostItem.Text
                              + "',cost_code=" + hCostItem.Value + ",cost_amt=" + txtCostAmt.Text
                              + " WHERE elt_account_number=" + elt_account_number + " AND hawb_num=N'" + txtHAWB.Text
                              + "'";
                }
            }

            // Direct Shipment
            else
            {
                // Other Charge
                if (txtItem.Text != "")
                {
                    tranStr = "UPDATE mawb_other_charge SET cost_desc=N'" + lstCostItem.Text
                              + "',cost_code=" + hCostItem.Value + ",cost_amt=" + txtCostAmt.Text
                              + " WHERE elt_account_number=" + elt_account_number + " AND mawb_num=N'" + txtMAWB.Text
                              + "' AND tran_no=" + txtItem.Text;
                }
                // Weight Charge
                else
                {
                    tranStr = "UPDATE mawb_weight_charge SET cost_desc=N'" + lstCostItem.Text
                              + "',cost_code=" + hCostItem.Value + ",cost_amt=" + txtCostAmt.Text
                              + " WHERE elt_account_number=" + elt_account_number + " AND mawb_num=N'" + txtMAWB.Text
                              + "'";
                }
            }

            feData.DataTransaction(tranStr);

            hSaved.Value = "Y";
        }
    }
Esempio n. 5
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Remove")
        {
            string sqlStr = "DELETE FROM country_code WHERE country_code='"
                            + e.CommandArgument.ToString() + "' AND elt_account_number=" + elt_account_number;
            FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData();
            FEData.DataTransaction(sqlStr);
        }

        GridView1.DataBind();
        GridView2.DataBind();
        Initialize_Components();
    }
Esempio n. 6
0
    protected void btnAddAll_Click(object sender, EventArgs e)
    {
        string sqlStr = "INSERT INTO country_code SELECT " + elt_account_number
                        + ",country_name,country_code FROM all_country_code WHERE "
                        + "country_code not in (SELECT country_code FROM country_code WHERE elt_account_number="
                        + elt_account_number + ")";

        FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData();
        FEData.DataTransaction(sqlStr);

        GridView1.DataBind();
        GridView2.DataBind();
        Initialize_Components();
    }
Esempio n. 7
0
    protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Add")
        {
            string sqlStr = "INSERT INTO country_code SELECT " + elt_account_number
                            + ",country_name,country_code FROM all_country_code WHERE country_code='"
                            + e.CommandArgument.ToString() + "'";
            FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData();
            FEData.DataTransaction(sqlStr);
        }

        GridView1.DataBind();
        GridView2.DataBind();
        Initialize_Components();
    }
Esempio n. 8
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Remove")
        {
            string sqlStr = "DELETE FROM ig_schedule_b WHERE elt_account_number="
                            + elt_account_number + " AND org_account_number=" + hOrgID.Value
                            + " AND sb_id=" + e.CommandArgument.ToString();

            FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData();
            FEData.DataTransaction(sqlStr);
        }

        GridView1.DataBind();
        GridView2.DataBind();
        Initialize_Components();
    }
Esempio n. 9
0
    protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Add")
        {
            string sqlStr = "INSERT INTO ig_schedule_b SELECT " + elt_account_number
                            + " AS elt_account_number," + hOrgID.Value + " AS org_account_number"
                            + ",sb,sb_unit1,sb_unit2,description,NULL AS is_org_merged,export_code,license_type,eccn,auto_uid"
                            + " FROM scheduleB WHERE elt_account_number=" + elt_account_number + " AND auto_uid=" + e.CommandArgument.ToString();

            FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData();
            FEData.DataTransaction(sqlStr);
        }

        GridView1.DataBind();
        GridView2.DataBind();
        Initialize_Components();
    }
Esempio n. 10
0
    protected void DeleteGeneralJournalEntry()
    {
        FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData();
        string tranStr = "";

        tranStr  = "DELETE FROM general_journal_entry WHERE elt_account_number=" + elt_account_number + " AND entry_no=" + hEntryNo.Value + "\n";
        tranStr += "DELETE FROM all_accounts_journal WHERE elt_account_number=" + elt_account_number + " AND tran_num=" + hEntryNo.Value + " AND tran_type='DEPOSIT'";


        if (!feData.DataTransaction(tranStr))
        {
            string errorStr = feData.GetLastTransactionError();
            string errorMsg = "Unexpected error occurred. " + errorStr;

            txtResultBox.Text    = tranStr;
            txtResultBox.Visible = true;
        }
    }