Example #1
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int    ClickNowSort  = 0;
        int    RdyChangeSort = 0;
        int    i             = 0;
        Button btnClick;
        Button btnRdyChange;

        if (e.CommandName == "btnSortUp")
        {
            if (int.Parse(e.CommandArgument.ToString()) > 0)
            {
                btnClick     = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString())].FindControl("Button2");
                btnRdyChange = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString()) - 1].FindControl("Button2");
                QnaInfo pdClick  = qBLL.GetDataById(int.Parse(btnClick.CommandArgument.ToString()));
                QnaInfo pdChange = qBLL.GetDataById(int.Parse(btnRdyChange.CommandArgument.ToString()));
                ClickNowSort    = pdClick.q_sort;
                RdyChangeSort   = pdChange.q_sort;
                pdClick.q_sort  = RdyChangeSort;
                pdChange.q_sort = ClickNowSort;
                if ((i = qBLL.Update(pdClick) + qBLL.Update(pdChange)) > 1)
                {
                    ShowMessage("排序成功");
                    ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("f_title", txtKeyWord.Text, ""));
                }
            }
            else
            {
                ShowMessage("此項目排序已是第一位");
            }
        }
        if (e.CommandName == "btnSortDown")
        {
            if (int.Parse(e.CommandArgument.ToString()) < GridView1.Rows.Count - 1)
            {
                btnClick     = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString())].FindControl("Button2");
                btnRdyChange = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString()) + 1].FindControl("Button2");
                QnaInfo pdClick  = qBLL.GetDataById(int.Parse(btnClick.CommandArgument.ToString()));
                QnaInfo pdChange = qBLL.GetDataById(int.Parse(btnRdyChange.CommandArgument.ToString()));
                ClickNowSort    = pdClick.q_sort;
                RdyChangeSort   = pdChange.q_sort;
                pdClick.q_sort  = RdyChangeSort;
                pdChange.q_sort = ClickNowSort;
                if ((i = qBLL.Update(pdClick) + qBLL.Update(pdChange)) > 1)
                {
                    ShowMessage("排序成功");
                    ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("f_title", txtKeyWord.Text, ""));
                }
            }
            else
            {
                ShowMessage("此項目排序已是最後一位");
            }
        }
    }
Example #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (rbProductName.Checked)
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("o_name", txtKeyWord.Text, ""));
     }
     else
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("o_number", txtKeyWord.Text, ""));
     }
 }
Example #3
0
 protected void Search()
 {
     if (rbTitle.Checked)
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("b_title", "b_title", "b_price", txtKeyWord.Text, Tools.TryParseMethod(ddrBannerCategory.SelectedValue), "bc_id", Tools.TryParseMethod(ddrBannerCustomer.SelectedValue), "bcs_id", Tools.TryParseMethod(ddrBannerLocation.SelectedValue), "bl_id", ""));
     }
     else
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("b_price", "b_title", "b_price", txtKeyWord.Text, Tools.TryParseMethod(ddrBannerCategory.SelectedValue), "bc_id", Tools.TryParseMethod(ddrBannerCustomer.SelectedValue), "bcs_id", Tools.TryParseMethod(ddrBannerLocation.SelectedValue), "bl_id", ""));
     }
 }
Example #4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (rbCompanyName.Checked)
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("bcs_company_name", txtKeyWord.Text, ""));
     }
     else if (rbName.Checked)
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("bcs_name", txtKeyWord.Text, ""));
     }
     else
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("bcs_key", txtKeyWord.Text, ""));
     }
 }
Example #5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (rbAccount.Checked)
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("m_account", txtKeyWord.Text, ""));
     }
     else if (rbNickname.Checked)
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("m_nickname", txtKeyWord.Text, ""));
     }
     else
     {
         ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("m_name", txtKeyWord.Text, ""));
     }
 }
Example #6
0
    protected void GoToPage_TextChanged(object sender, EventArgs e)
    {
        TextBox txtgotopage = (TextBox)sender;
        int     pageNumber;

        if (int.TryParse(txtgotopage.Text.Trim(), out pageNumber) && pageNumber > 0 && pageNumber <= this.GridView1.PageCount)
        {
            this.GridView1.PageIndex = pageNumber - 1;
        }
        else
        {
            this.GridView1.PageIndex = GridView1.PageCount - 1;
            AddMethodSystem.ShowBox(UpdatePanel1, this.GetType(), "valuebig", "alert('超出分頁最大值');window.location.href");
            ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("pc_name", txtKeyWord.Text, int.Parse(ddrCategory.SelectedValue), "pc_fatherid", lid, "l_id", ""));
        }
    }
Example #7
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("pc_name", txtKeyWord.Text, int.Parse(ddrCategory.SelectedValue), "pc_fatherid", lid, "l_id", ""));
 }
Example #8
0
    //public string getTitle(int id)
    //{
    //    if (id == 0)
    //    {
    //        return "";
    //    }

    //    return info.nc_name;
    //}
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("n_title", txtKeyWord.Text, int.Parse(ddrCategory.SelectedValue), "nc_id", lid, "l_id", ""));
    }
Example #9
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("gb_title", txtKeyWord.Text, ""));
 }
 protected void Button1_Click(object sender, EventArgs e)
 {
     ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("sc_Name", txtKeyWord.Text, ddrCategory.SelectedValue, "sc_Class", ""));
 }
Example #11
0
 protected void GridView1_PageIndexChanged(object sender, EventArgs e)
 {
     ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("bl_title", txtKeyWord.Text, Tools.TryParseMethod(ddlCategory.SelectedValue), "bl_father_id", ""));
 }