Exemplo n.º 1
0
    protected void btnSearchSubmit_Click(object sender, EventArgs e)
    {
        logger.Info(HttpContext.Current.Request.Cookies["User_ID"].Value + " " + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString() + " " + System.Reflection.MethodBase.GetCurrentMethod().Name);

        string        User_ID    = HttpContext.Current.Request.Cookies["User_ID"].Value;
        dbo_UserClass user_class = dbo_UserDataClass.Select_Record(User_ID);

        try
        {
            DateTime?Post_Date_Begin = null;
            DateTime?Post_Date_End   = null;
            if (!string.IsNullOrEmpty(txtStartDate.Text))
            {
                Post_Date_Begin = DateTime.Parse(txtStartDate.Text);
            }
            if (!string.IsNullOrEmpty(txtEndDate.Text))
            {
                Post_Date_End = DateTime.Parse(txtEndDate.Text);
            }
            List <dbo_RevenueExpenseClass> item = dbo_RevenueExpenseDataClass.GetRevenueExpense(Post_Date_Begin, Post_Date_End, user_class.CV_CODE);

            if (item.Count > 0)
            {
                GridViewRevenue_Expense.DataSource = item;
                GridViewRevenue_Expense.DataBind();

                GridViewRevenue_Expense.Visible = true;
                pnlNoRec.Visible = false;
            }
            else
            {
                GridViewRevenue_Expense.Visible = false;
                pnlNoRec.Visible = true;
            }

            System.Threading.Thread.Sleep(500);
            ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true);
        }
        catch (Exception ex)
        {
            logger.Error(ex.Message);
        }
    }
Exemplo n.º 2
0
    protected void btnSearchCancel_Click(object sender, EventArgs e)
    {
        logger.Info(HttpContext.Current.Request.Cookies["User_ID"].Value + " " + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString() + " " + System.Reflection.MethodBase.GetCurrentMethod().Name);

        txtStartDate.Text = DateTime.Now.ToShortDateString();
        txtEndDate.Text   = DateTime.Now.ToShortDateString();
        if (GridViewRevenue_Expense.Rows.Count > 0)
        {
            List <dbo_RevenueExpenseClass> itm = new List <dbo_RevenueExpenseClass>();
            GridViewRevenue_Expense.DataSource = itm;
            GridViewRevenue_Expense.DataBind();
        }


        GridViewRevenue_Expense.Visible = false;
        pnlNoRec.Visible = false;

        System.Threading.Thread.Sleep(500);
        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true);
    }