示例#1
0
    protected void ButtonSearch_Click(object sender, EventArgs e)
    {
        PanelOverTimeNew.Visible = false;
        UpdatePanelOverTimeNew.Update();
        Panel_Parameter.Visible = false;
        UpdatePanel_Parameter.Update();
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
        Label_Grid1_State.Text = "模糊搜索数据源";
        string name = TextBoxOverTime.Text;

        if (name != "")
        {
            Session["BindTable"] = OverTimeOption.SearchOverTime(name);
            BindData();
            UpdatePanelList.Update();
        }
        else
        {
            Label_Grid1_State.Text = "默认数据源";
            Session["BindTable"]   = OverTimeOption.BindOverTime();
            BindData();
            UpdatePanelList.Update();
        }
    }
示例#2
0
    protected void ButtonSubmit_Click(object sender, EventArgs e)
    {
        string UnitName = TextBoxNew.Text;

        if (UnitName == "")
        {
            Message.Text = "请输入要添加的用量单位!";
            UpdatePanelList.Update();
        }
        else if (BLLCraftBasicInfoMgt.SearchSameUnit(UnitName))
        {
            if (BLLCraftBasicInfoMgt.AddUnit(UnitName))
            {
                Message.Text         = "数据已成功添加!";
                TextBoxNew.Text      = "";
                PanelUnitNew.Visible = false;//Panel不可见
            }
            else
            {
                Message.Text = "数据未成功添加!";
            }
            Session["BindTable"] = BLLCraftBasicInfoMgt.BindUnit();
            BindData();
            UpdatePanelList.Update();
        }
        else
        {
            Message.Text = "用量单位重复!";
            UpdatePanelList.Update();
        }
    }
示例#3
0
 protected void ButtonReset_Click(object sender, EventArgs e)
 {
     TextBoxUnit.Text       = "";
     Label_Grid1_State.Text = "默认数据源";
     Session["BindTable"]   = BLLCraftBasicInfoMgt.BindUnit();
     BindData();
     UpdatePanelList.Update();
 }
示例#4
0
 protected void Btn_Close_Parameter_Click(object sender, EventArgs e)
 {
     GridViewOverTime.SelectedIndex = -1;
     Panel_Parameter.Visible        = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
     UpdatePanelList.Update();
 }
示例#5
0
    protected void GridViewOverTime_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        if (-2 == e.NewPageIndex)
        { // when click the "GO" Button
            TextBox     txtNewPageIndex = null;
            GridViewRow pagerRow        = GridViewOverTime.BottomPagerRow;


            if (null != pagerRow)
            {
                txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox");   // refer to the TextBox with the NewPageIndex value
            }

            if (null != txtNewPageIndex && txtNewPageIndex.Text != "")
            {
                newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex
            }
        }
        else
        {  // when click the first, last, previous and next Button
            newPageIndex = e.NewPageIndex;
        }

        // check to prevent form the NewPageIndex out of the range


        if (Label_Grid1_State.Text == "默认数据源")
        {
            Session["BindTable"] = OverTimeOption.BindOverTime();
            BindData();
            UpdatePanelList.Update();
        }
        if (Label_Grid1_State.Text == "模糊搜索数据源")
        {
            Session["BindTable"] = OverTimeOption.SearchOverTime(TextBoxOverTime.Text.Trim());
            BindData();
            UpdatePanelList.Update();
        } //绑定数据源

        //bindgridview();
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= GridViewOverTime.PageCount ? GridViewOverTime.PageCount - 1 : newPageIndex;

        // specify the NewPageIndex
        GridViewOverTime.PageIndex = newPageIndex;

        GridViewOverTime.PageIndex = newPageIndex;
        GridViewOverTime.DataBind();
    }
示例#6
0
 protected void ButtonNew_Click(object sender, EventArgs e)
 {
     PanelOverTimeNew.Visible = true;//Panel可见
     UpdatePanelOverTimeNew.Update();
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
     GridViewOverTime.EditIndex = -1;
     Session["BindTable"]       = OverTimeOption.BindOverTime();
     BindData();
     UpdatePanelList.Update();
 }
示例#7
0
    protected void ButtonSearch_Click(object sender, EventArgs e)
    {
        Label_Grid1_State.Text = "模糊搜索数据源";
        string name = TextBoxUnit.Text;

        if (name != "")
        {
            Session["BindTable"] = BLLCraftBasicInfoMgt.SearchUnit(name);
            BindData();
            UpdatePanelList.Update();
        }
        else
        {
            Label_Grid1_State.Text = "默认数据源";
            Session["BindTable"]   = BLLCraftBasicInfoMgt.BindUnit();
            BindData();
            UpdatePanelList.Update();
        }
    }
示例#8
0
    protected void ButtonSubmit_Click(object sender, EventArgs e)
    {
        string OtoName = TextBoxNew.Text;

        //if (OtoName == "")
        //{
        //    Message.Text = "请输入要添加的超时原因!";
        //    UpdatePanelList.Update();
        //}
        if (TextBoxNew.Text.ToString() == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        else if (OverTimeOption.SearchSameOverTime(OtoName))
        {
            if (OverTimeOption.AddOverTime(OtoName))
            {
                //Message.Text = "数据已成功添加!";
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('数据已成功添加!')", true);
                TextBoxNew.Text          = "";
                PanelOverTimeNew.Visible = false;//Panel不可见
            }
            else
            {
                //Message.Text = "数据未成功添加!";
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('数据未成功添加!')", true);
                return;
            }
            Session["BindTable"] = OverTimeOption.BindOverTime();
            BindData();
        }
        else
        {
            //Message.Text = "超时原因重复!";
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('超时原因重复!')", true);
            return;
        }
        UpdatePanelList.Update();
    }