Beispiel #1
0
    }//取消编辑//当为commandField时使用这种,为模板列连接按钮使用rowcommand根据command那么不同来操作

    protected void GridView_IMStore_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        imssdinfo.IMS_StoreID      = new Guid(GridView_IMStore.DataKeys[e.RowIndex].Value.ToString());
        imssdinfo.IMS_ResponDepart = Convert.ToString(((TextBox)(GridView_IMStore.Rows[e.RowIndex].Cells[2].Controls[0])).Text.Trim().ToString());
        imssdinfo.IMS_ResponMan    = Convert.ToString(((TextBox)(GridView_IMStore.Rows[e.RowIndex].Cells[3].Controls[0])).Text.Trim().ToString());
        PSB.U_IMstore(imssdinfo);
        GridView_IMStore.EditIndex  = -1;
        GridView_IMStore.DataSource = PSB.SList_Istore();
        GridView_IMStore.DataBind();
        UpdatePanel_IMStore.Update();
    }//更新//当为commandField时使用这种,为模板列连接按钮使用rowcommand根据command那么不同来操作
Beispiel #2
0
    protected void Btn_EditStore_Click(object sender, EventArgs e)
    {
        if (flag_STOre == 1)
        {
            imssdinfo.Flag          = 1;
            imssdinfo.IMS_StoreName = TextBox_Store.Text.Trim().ToString();

            if (TextBox_Store.Text.Trim().ToString() != "" && TextBox_StoreManger.Text.Trim().ToString() != "" && TextBox_StoreManger0.Text.Trim().ToString() != "")
            {
                DataSet   ds = PSB.SList_Imstore_Name(TextBox_Store.Text.Trim().ToString());
                DataTable dt = ds.Tables[0];
                DataView  dv = ds.Tables[0].DefaultView;
                if (dt.Rows.Count != 0)
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('系统中已有该库房名称,不能重名!')", true);
                    return;
                }
                else
                {
                    imssdinfo.IMS_ResponDepart = TextBox_StoreManger0.Text.Trim().ToString().Substring(0, TextBox_StoreManger0.Text.Trim().ToString().Length - 1);
                    imssdinfo.IMS_ResponMan    = TextBox_StoreManger.Text.Trim().ToString().Substring(0, TextBox_StoreManger.Text.Trim().ToString().Length - 1);
                    PSB.I_IMstore_new(imssdinfo);
                    GridView_IMStore.DataSource = PSB.SList_Istore();
                    GridView_IMStore.DataBind();
                    Panel_EditStore.Visible = false;
                    Panel_findMan.Visible   = false;
                    UpdatePanel_EditStore.Update();
                    UpdatePanel_findMan.Update();
                    UpdatePanel_IMStore.Update();

                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('库房新增成功!')", true);
                    return;
                }
            }
            else
            {
                if (TextBox_Store.Text.Trim().ToString() == "")
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('库房名称不能为空!')", true);
                    return;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请选择管理人员及部门!')", true);
                    return;
                }
            }
        }
        else
        if (flag_STOre == 0)
        {
            imssdinfo.Flag = 0;
            Guid STORE_ID = new Guid(Session["store11_id"].ToString());
            imssdinfo.IMS_StoreID = STORE_ID;

            imssdinfo.IMS_StoreName    = TextBox_Store.Text.Trim().ToString();
            imssdinfo.IMS_ResponDepart = TextBox_StoreManger0.Text.Trim().ToString().Substring(0, TextBox_StoreManger0.Text.Trim().ToString().Length - 1);
            imssdinfo.IMS_ResponMan    = TextBox_StoreManger.Text.Trim().ToString().Substring(0, TextBox_StoreManger.Text.Trim().ToString().Length - 1);
            PSB.I_IMstore_new(imssdinfo);
            GridView_IMStore.DataSource = PSB.SList_Istore();
            GridView_IMStore.DataBind();
            Panel_EditStore.Visible = false;
            Panel_findMan.Visible   = false;
            UpdatePanel_EditStore.Update();
            UpdatePanel_findMan.Update();
            UpdatePanel_IMStore.Update();

            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('库房修改成功!')", true);
            return;
        }
    }
Beispiel #3
0
    protected void GridView_IMStore_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "bianji")
        {
            flag_STOre            = 0;
            Session["store11_id"] = e.CommandArgument.ToString();
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_IMStore.SelectedIndex = row.RowIndex;
            GridView_IMStore.SelectedIndex = -1;

            string Store_name = row.Cells[1].Text.Trim().ToString();
            i = 0;
            TextBox_Store.Text            = Store_name;
            TextBox_Store.ReadOnly        = true;
            TextBox_Store.Enabled         = false;
            TextBox_StoreManger.Text      = "";
            TextBox_StoreManger0.Text     = "";
            TextBox_StoreManger.ReadOnly  = true;
            TextBox_StoreManger.Enabled   = false;
            TextBox_StoreManger0.ReadOnly = true;
            TextBox_StoreManger0.Enabled  = false;
            Panel_EditStore.Visible       = true;
            UpdatePanel_EditStore.Update();
        }
        else
        if (e.CommandName == "dele")
        {
            string id      = e.CommandArgument.ToString();
            Guid   guid_id = new Guid(id);
            PSB.D_IMstore(guid_id);

            GridView_IMStore.DataSource = PSB.SList_Istore();
            GridView_IMStore.DataBind();
            UpdatePanel_IMStore.Update();

            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true);
            return;
        }
        else
        if (e.CommandName == "SET")
        {
            Panel_areal.Visible     = true;
            Panel_arealedit.Visible = true;

            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_IMStore.SelectedIndex = row.RowIndex;
            GridView_IMStore.SelectedIndex = -1;
            Store_Name = row.Cells[1].Text.Trim().ToString();
            string id      = e.CommandArgument.ToString();
            Guid   guid_id = new Guid(id);
            areal_guid = guid_id;
            GridView_areal.DataSource = PSB.S_STOREareal(areal_guid);
            GridView_areal.DataBind();
            UpdatePanel_areal.Update();
            UpdatePanel_arealedit.Update();
        }
        else
        if (e.CommandName == "SEE")
        {
            Panel_areal.Visible = true;

            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_IMStore.SelectedIndex = row.RowIndex;
            GridView_IMStore.SelectedIndex = -1;
            Store_Name = row.Cells[1].Text.Trim().ToString();
            string id      = e.CommandArgument.ToString();
            Guid   guid_id = new Guid(id);
            areal_guid = guid_id;
            GridView_areal.DataSource = PSB.S_STOREareal(areal_guid);
            GridView_areal.DataBind();
            GridView_areal.Columns[4].Visible = false;
            GridView_areal.Columns[5].Visible = false;
            UpdatePanel_areal.Update();
            UpdatePanel_arealedit.Update();
        }
    } //linkbutton链接按钮根据自身Commandname来触发不同事件