protected void Btn_FindMan_Click(object sender, EventArgs e) { DropDownList_Depart.SelectedValue = "请选择"; TextBox_DptMan.Text = ""; Panel_findMan.Visible = true; UpdatePanel_findMan.Update(); }
protected void Btn_EditCancel_Click(object sender, EventArgs e) { Panel_EditStore.Visible = false; Panel_findMan.Visible = false; UpdatePanel_EditStore.Update(); UpdatePanel_findMan.Update(); }
protected void Btn_renewl0_Click(object sender, EventArgs e)//重新添加管理人员与部门 { i = 0; TextBox_StoreManger.Text = ""; TextBox_StoreManger0.Text = ""; UpdatePanel_EditStore.Update(); UpdatePanel_findMan.Update(); }
protected void Btn_DeprtMan_Click(object sender, EventArgs e)//检索库房管理人员 { //Depart = DropDownList_Depart.Text.Trim().ToString(); //Manger = TextBox_DptMan.Text.Trim().ToString(); string temp = ""; if (DropDownList_Depart.SelectedValue != "请选择") { temp += " and b.BDOS_Name like '%" + DropDownList_Depart.SelectedValue.ToString() + "%'"; } if (TextBox_DptMan.Text != "") { temp += " and a.UMUI_UserName like '%" + TextBox_DptMan.Text.ToString() + "%'"; } Label1.Text = temp; GridView_Depart.DataSource = PSB.SList_ImstoreManger(Label1.Text); GridView_Depart.DataBind(); UpdatePanel_findMan.Update(); }
}//更新//当为commandField时使用这种,为模板列连接按钮使用rowcommand根据command那么不同来操作 #endregion #region 库房管理人员查询表的后台事件 protected void GridView_Depart_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 = GridView_Depart.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 // newPageIndex = newPageIndex < 0 ? 0 : newPageIndex; // newPageIndex = newPageIndex >= GridView_Depart.PageCount ? GridView_Depart.PageCount - 1 : newPageIndex; // specify the NewPageIndex // GridView_Depart.PageIndex = newPageIndex; // GridView_Depart.PageIndex = newPageIndex; GridView_Depart.DataSource = PSB.SList_ImstoreManger(Label1.Text); GridView_Depart.DataBind(); UpdatePanel_findMan.Update(); newPageIndex = newPageIndex < 0 ? 0 : newPageIndex; newPageIndex = newPageIndex >= GridView_Depart.PageCount ? GridView_Depart.PageCount - 1 : newPageIndex; GridView_Depart.PageIndex = newPageIndex; GridView_Depart.DataBind(); } //读取go前textbox,导航到指定页面
} //读取go前textbox,导航到指定页面 protected void GridView_Depart_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add1") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Depart.SelectedIndex = row.RowIndex; GridView_Depart.SelectedIndex = -1; // this.Lab_State.Text = "Delete1"; string id = e.CommandArgument.ToString(); CheckBox box = (CheckBox)row.FindControl("CheckBox2"); box.Checked = true; string depart = row.Cells[2].Text.Trim().ToString(); string Name = row.Cells[3].Text.Trim().ToString(); int j = 0; int flag = 0; for (j = 0; j < i; j++) { if (depart.ToString() == a[j].ToString()) { flag = 1; } } if (flag == 0) { TextBox_StoreManger0.Text = TextBox_StoreManger0.Text.Trim().ToString() + depart + ","; a[i] = depart; i++; } else { flag = 0; TextBox_StoreManger0.Text = TextBox_StoreManger0.Text.Trim().ToString(); } TextBox_StoreManger.Text = TextBox_StoreManger.Text.Trim().ToString() + Name + ","; UpdatePanel_findMan.Update(); UpdatePanel_EditStore.Update(); } }
protected void Btn_confirm_Click(object sender, EventArgs e) { Panel_findMan.Visible = false; UpdatePanel_findMan.Update(); }
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; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GridView_Depart.DataSource = PSB.SList_ImstoreManger(Label1.Text); GridView_Depart.DataBind(); UpdatePanel_findMan.Update(); //GridView_Depart.DataSource = PSB.SList_User_IMstore(); //GridView_Depart.DataBind(); /*this.GridView_IMSSBD.DataSource = PSB.SList_IMssd_in_out(IN.ToString(), OUT.ToString()); * this.GridView_IMSSBD.DataBind(); * this.GridView_IMStore.DataSource = PSB.SList_Istore(); * this.GridView_IMStore.DataBind(); * this.GridView_Depart.DataSource = PSB.SList_User_IMstore(); * this.GridView_Depart.DataBind(); * this.DropDownList_Depart.DataSource = PSB.SList_DROP_Depart(); * this.DropDownList_Depart.DataBind(); * GridView_IMSSBD.Attributes.Add("style", "table-layout:fixed");*/ } if (Request.QueryString["status"] == "SeeSSd")//出入库类别查看权限 { Title = "出入库类别查看"; Panel_IMStore.Visible = false; Button_StoreIn.Visible = false; Button_StoreOut.Visible = false; GridView_IMSSBD.Columns[4].Visible = false; GridView_IMSSBD.Columns[5].Visible = false; GridView_IMSSBD.DataSource = PSB.SList_IMssd_in_out(IN.ToString(), OUT.ToString()); GridView_IMSSBD.DataBind(); GridView_IMSSBD.Attributes.Add("style", "table-layout:fixed"); } else if (Request.QueryString["status"] == "EdditSSd") //出入库类别编辑权限 { Title = "出入库类别维护"; Panel_IMStore.Visible = false; Button_StoreIn.Visible = true; Button_StoreOut.Visible = true; GridView_IMSSBD.Columns[4].Visible = true; GridView_IMSSBD.Columns[5].Visible = true; GridView_IMSSBD.DataSource = PSB.SList_IMssd_in_out(IN.ToString(), OUT.ToString()); GridView_IMSSBD.DataBind(); GridView_IMSSBD.Attributes.Add("style", "table-layout:fixed"); } else if (Request.QueryString["status"] == "SeeStore") //库房查看权限 { Title = "库房查看"; Panel_StoreSearch.Visible = false; Panel_IMSSBD.Visible = false; Btn_NewStore.Visible = false; GridView_IMStore.DataSource = PSB.SList_Istore(); GridView_IMStore.DataBind(); GridView_IMStore.Columns[4].Visible = false; GridView_IMStore.Columns[5].Visible = false; GridView_IMStore.Columns[6].Visible = false; GridView_IMStore.Columns[7].Visible = false; } else if (Request.QueryString["status"] == "SeeAreal") //区域查看权限 { Title = "库存区域查看"; Panel_StoreSearch.Visible = false; Panel_IMSSBD.Visible = false; Btn_NewStore.Visible = false; GridView_IMStore.DataSource = PSB.SList_Istore(); GridView_IMStore.DataBind(); GridView_IMStore.Columns[4].Visible = false; GridView_IMStore.Columns[5].Visible = false; GridView_IMStore.Columns[6].Visible = false; } else if (Request.QueryString["status"] == "EditStore") //库房编辑权限 { Title = "库存区域维护"; Panel_StoreSearch.Visible = false; Panel_IMSSBD.Visible = false; GridView_IMStore.Columns[7].Visible = false; GridView_IMStore.DataSource = PSB.SList_Istore(); GridView_IMStore.DataBind(); //GridView_Depart.DataSource = PSB.SList_User_IMstore(); //GridView_Depart.DataBind(); DropDownList_Depart.DataSource = PSB.SList_DROP_Depart(); DropDownList_Depart.DataBind(); } }