Esempio n. 1
0
    public void databind1()
    {
        string condition;
        string CSN_Name = TextBox_CS_Search.Text.Trim() == "" ? " and 1=1 " : " and CSN_Name like '%" + TextBox_CS_Search.Text.Trim() + "%' ";

        condition = CSN_Name;
        GridView_CS.DataSource = csl.S_CSName(condition);
        GridView_CS.DataBind();
        UpdatePanel_CS.Update();
    }
Esempio n. 2
0
    public void databind1()
    {
        string condition;
        string CI_P = TextBox_makepeople.Text.Trim() == "" ? " and 1=1 " : " and CI_P like '%" + TextBox_makepeople.Text.Trim() + "%' ";

        if ((TextBox_WO_Time1.Text != "" && TextBox_WO_Time2.Text == "") || (TextBox_WO_Time1.Text == "" && TextBox_WO_Time2.Text != ""))
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请将时间检索范围输入完整,请您再次核对!')", true);
            return;
        }
        string CI_T = (TextBox_WO_Time1.Text.Trim() == "" && TextBox_WO_Time2.Text.Trim() == "") ? " and 1=1 " : " and CI_T between   ' " + TextBox_WO_Time1.Text.Trim() + "' and ' " + TextBox_WO_Time2.Text.Trim() + "'";


        condition = CI_P + CI_T;
        GridView_CS.DataSource = csl.S_CapacityInfo(condition);
        GridView_CS.DataBind();
        UpdatePanel_CS.Update();
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LbCanBeUsedItem.Attributes.Add("onClick", "listboxSelect()");    //为listbox注册客户端单击事件

            try
            {
                if (!((Session["UserRole"].ToString().Contains("产能核定基础信息维护")) || (Session["UserRole"].ToString().Contains("产能核定基础信息查看"))))
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true);
                    Response.Redirect("~/Default.aspx");
                }
                label_pagestate.Text = Request.QueryString["state"];
                string state = label_pagestate.Text;
                if (Session["UserRole"].ToString().Contains("产能核定基础信息查看") && state.Trim() == "look")
                {
                    Title = "产能核定基础信息查看";
                    GridView_CS.Columns[2].Visible = false;
                    GridView_CS.Columns[3].Visible = false;
                    Button_AddCS.Visible           = false;
                    Button_AddPT.Visible           = false;
                    GridView_PT.Columns[2].Visible = false;

                    GridView_Basic.Columns[5].Visible = false;
                    GridView_Basic.Columns[6].Visible = false;
                    Button_AddBasic.Visible           = false;
                }
                if (Session["UserRole"].ToString().Contains("产能核定基础信息维护") && state.Trim() == "manage")
                {
                    Title = "产能核定基础信息维护";
                }
                label_GridPageState.Text = "默认数据源";
                string condition = " and 1=1";
                GridView_CS.DataSource = csl.S_CSName(condition);
                GridView_CS.DataBind();
                UpdatePanel_CS.Update();
                GridView_CS.SelectedIndex = -1;

                // GridView_Detail.EditIndex = -1;
                //各种pannel隐藏
                Panel_Add.Visible = false;
                UpdatePanel_Add.Update();
                Panel_PT.Visible = false;
                UpdatePanel_PT.Update();
                Panel_Product.Visible = false;
                UpdatePanel_Product.Update();
                Panel_Basic.Visible = false;
                TextBox_PBC.Text    = "";
                UpdatePanel_Basic.Update();
                TextBox_PT.Text          = "";
                TextBox_Series.Text      = "";
                TextBox_ProductName.Text = "";
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true);
                Response.Redirect("~/Default.aspx");
            }
        }
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Request.QueryString["state"] == null)
            {
                label_pagestate.Text = "look";
            }
            else
            {
                label_pagestate.Text = Request.QueryString["state"];
            }
            string state = label_pagestate.Text;
            if (state.Trim() == "look")
            {
                Title = "产能核定查看";
                GridView_CS.Columns[4].Visible             = false;
                GridView_CS.Columns[5].Visible             = false;
                GridView_CS.Columns[6].Visible             = false;
                Button_Add.Visible                         = false;
                GridView_PBCraftDetail.Columns[12].Visible = false;
            }
            if (state.Trim() == "manage")
            {
                Title = "产能核定维护";
            }
            if (!IsPostBack)
            {
                try
                {
                    if (!((Session["UserRole"].ToString().Contains("产能核定维护")) || (Session["UserRole"].ToString().Contains("产能核定查看"))))
                    {
                        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true);

                        Response.Redirect("~/Default.aspx");
                    }
                    if (!Session["UserRole"].ToString().Contains("产能核定维护"))
                    {
                        //this.Title = "产能核定基础信息查看";
                        GridView_CS.Columns[4].Visible             = false;
                        GridView_CS.Columns[5].Visible             = false;
                        GridView_CS.Columns[6].Visible             = false;
                        Button_Add.Visible                         = false;
                        GridView_PBCraftDetail.Columns[12].Visible = false;
                    }


                    label_GridPageState.Text = "默认数据源";
                    string condition = " and 1=1";
                    GridView_CS.DataSource = csl.S_CapacityInfo(condition);
                    GridView_CS.DataBind();
                    UpdatePanel_CS.Update();
                    GridView_CS.SelectedIndex = -1;
                    //各种pannel隐藏
                    Panel_Add.Visible = false;
                    UpdatePanel_Add.Update();
                    TextBox_Note_Add.Text       = "";
                    GridView_CS.EditIndex       = -1;
                    GridView_CS.SelectedIndex   = -1;
                    Panel_PBC.Visible           = false;
                    GridView_PBC.SelectedIndex  = -1;
                    Panel_PBCraftDetail.Visible = false;
                    Panel_ResultCheck.Visible   = false;
                    UpdatePanel_ResultCheck.Update();
                }

                catch (Exception)
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true);
                    Response.Redirect("~/Default.aspx");
                }
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true);
            Response.Redirect("~/Default.aspx");
        }
    }