protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //txt_AccessTime.Attributes.Add("OnFocus", "javascript:calendar()"); txt_QueryTime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); //txt_endtime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"); // txt_receivetime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"); txt_QueryEndTime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); //txt_ReportTime.Attributes.Add("OnFocus", "javascript:calendar()"); txt_QueryTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); txt_QueryEndTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); MyStaVoid.BindList("ClassName", "ClassID", "select * from t_M_AnalysisMainClassEx order by ClassCode asc", cbl_type); ListItem choose = new ListItem("全部", "-1"); //DropList_AnalysisMainItem_SelectedIndexChanged(null, null); MyStaVoid.BindList("ItemName", "ItemID", "select ItemID, ItemName from t_M_ItemInfo order by ItemName ", txt_item); txt_item.Items.Add(choose); txt_item.Items.FindByValue("-1").Selected = true; //MyStaVoid.BindList("SampleType", "TypeID", "select TypeID, SampleType from t_M_SampleType order by SampleType ", txt_type); //txt_type.Items.Add(choose); //txt_type.Items.FindByValue("-1").Selected = true; //MyStaVoid.BindList("Status", "StatusID", "select StatusID, Status from t_M_StatusInfo order by StatusID ", drop_status); //drop_status.Items.Add(choose); //drop_status.Items.FindByValue("-1").Selected = true; MyStaVoid.BindList("ClientName", "id", "select id,ClientName from t_M_ClientInfo order by id ", drop_client); drop_client.Items.Add(choose); drop_client.Items.FindByValue("-1").Selected = true; btn_query_Click(null, null); //grdvw_List.Caption = "<FONT style='WIDTH: 102.16%;font-size:22pt; LINE-HEIGHT: 150%; FONT-FAMILY: SimSun_GB2312; HEIGHT: 35px'><b>样 品 登 记 表</b></font>"; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["Cookies"] != null) { if (!IsPostBack) { #region 初始化页面元素 string sql = "select name from t_R_UserInfo where userid = '" + Request.Cookies["Cookies"].Values["u_id"].ToString().Trim() + "'"; DataSet ds = new MyDataOp(sql).CreateDataSet(); name = ds.Tables[0].Rows[0][0].ToString(); MyStaVoid.BindList("DepartName", "DepartID", "select DepartName,DepartID from t_M_DepartInfo where flag='1'", drop_depart); ListItem li = new ListItem("所有", "-1"); drop_depart.Items.Add(li); drop_depart.SelectedIndex = drop_depart.Items.Count - 1; //SetTxt(); //SetButton(); txts_time1.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); txts_time1.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); txts_time2.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); txts_time2.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); txt_date.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); grdvw_List.Caption = "<FONT style='WIDTH: 102.16%; COLOR: #2292DD;font-size:14pt; LINE-HEIGHT: 100%; FONT-FAMILY: 楷体_GB2312; HEIGHT: 35px'><b>加班记录列表</b></font>"; txt_time1.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'HH:mm'})"); txt_time2.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'HH:mm'})"); #endregion Query(); } } else { Response.Write("<script language='javascript'>alert('您没有权限进入本页或当前登录用户已过期!\\n请重新登录或与管理员联系!');parent.location='../login.aspx';</script>"); } }
protected void grdvw_List_RowSelecting(object sender, GridViewSelectEventArgs e) { strSelectedId = grdvw_List.Rows[e.NewSelectedIndex].Cells[1].Text.Trim(); strSampleId = grdvw_List.Rows[e.NewSelectedIndex].Cells[5].Text.Trim(); lbl_sample.Text = grdvw_List.Rows[e.NewSelectedIndex].Cells[5].Text.Trim(); MyStaVoid.BindList("ClassName", "ClassID", "select * from t_M_AnalysisMainClass order by ClassCode asc", DropList_AnalysisMainItem); ListItem choose = new ListItem("全部", "-1"); DropList_AnalysisMainItem.SelectedItem.Selected = false; DropList_AnalysisMainItem.Items.Add(choose); DropList_AnalysisMainItem.Items.FindByValue("-1").Selected = true; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "showAddEditAnalysisAdd();hiddenDetail();", true); if (grdvw_List.Rows[e.NewSelectedIndex].Cells[12].Text.Trim() != " ") { txt_send.Text = grdvw_List.Rows[e.NewSelectedIndex].Cells[12].Text.Trim(); } // if (grdvw_List.Rows[e.NewSelectedIndex].Cells[15].Text.Trim() != " ") //txt_wtdepart.Text = grdvw_List.Rows[e.NewSelectedIndex].Cells[15].Text.Trim(); string retstr = ""; List <string> namelist = new List <string>(); namelist = getnum(lbl_sample.Text, ref retstr); if (retstr != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('" + retstr + "');", true); } txt_num.Text = namelist.Count.ToString(); if (grdvw_List.Rows[e.NewSelectedIndex].Cells[14].Text != " ") { txt_num.Text = grdvw_List.Rows[e.NewSelectedIndex].Cells[14].Text; } DataBindAll(); }
protected void SetButton() { if (!MyStaVoid.isWrite(Request.Cookies["Cookies"].Values["uid"].ToString(), this.Request.Url.Segments[this.Request.Url.Segments.Length - 1].ToString())) { btn_Add.Enabled = false; btn_OK.Enabled = false; btn_Save.Enabled = false; } else { btn_Add.Enabled = true; btn_OK.Enabled = true; btn_Save.Enabled = true; // btn_AddSample.Enabled = true; // btn_OKSample.Enabled = true; // btn_item.Enabled = true; //for (int i = 0; i < grdvw_List.Rows.Count; i++) //{ // ImageButton btn = (ImageButton)grdvw_List.Rows[i].FindControl("btn_delete"); // if(btn!=null) // btn.Visible = true; //} } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //txt_AccessTime.Attributes.Add("OnFocus", "javascript:calendar()"); txt_QueryTime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); //txt_endtime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"); //txt_receivetime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"); txt_QueryEndTime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); //txt_ReportTime.Attributes.Add("OnFocus", "javascript:calendar()"); txt_QueryTime.Text = DateTime.Now.Date.ToString("yyyy-01-01"); txt_QueryEndTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); MyStaVoid.BindList("ClassName", "ClassID", "select * from t_M_AnalysisMainClassEx order by ClassCode asc", txt_type); ListItem choose = new ListItem("全部", "-1"); txt_type.SelectedItem.Selected = false; txt_type.Items.Add(choose); txt_type.Items.FindByValue("-1").Selected = true; DropList_AnalysisMainItem_SelectedIndexChanged(null, null); MyStaVoid.BindList("ItemName", "ItemID", "select ItemID, ItemName from t_M_ItemInfo order by ItemName ", txt_item); txt_item.Items.Add(choose); txt_item.Items.FindByValue("-1").Selected = true; //MyStaVoid.BindList("SampleType", "TypeID", "select TypeID, SampleType from t_M_SampleType order by SampleType ", txt_type); //txt_type.Items.Add(choose); //txt_type.Items.FindByValue("-1").Selected = true; MyStaVoid.BindList("Status", "StatusID", "select StatusID, Status from t_M_StatusInfo order by StatusID ", drop_status); drop_status.Items.Add(choose); drop_status.Items.FindByValue("-1").Selected = true; MyStaVoid.BindList("ClientName", "id", "select id,ClientName from t_M_ClientInfo order by id ", drop_client); drop_client.Items.Add(choose); drop_client.Items.FindByValue("-1").Selected = true; Query(0); } }
protected void Page_Load(object sender, EventArgs e) { this.Title = "日志列表"; if (!IsPostBack) { try { num = int.Parse(System.Configuration.ConfigurationManager.AppSettings["num"]); } catch { num = 8; } #region 初始化页面 txt_StartTime.Attributes.Add("OnFocus", "javascript:calendar()"); txt_EndTime.Attributes.Add("OnFocus", "javascript:calendar()"); txt_StartTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); txt_EndTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); MyStaVoid.BindList("DepartName", "DepartID", "select * from t_M_DepartInfo where DepartID!='0'", ddl_depart); ListItem li = new ListItem("所有", "-1"); ddl_depart.Items.Add(li); ddl_depart.SelectedIndex = ddl_depart.Items.Count - 1; Query(0); #endregion } }
private void CleanAllText()//清空详细页面中所有的TextBox { MyStaVoid.BindList("bz", "id", "select * from t_标准字典 where id!=7", drop_bz); MyStaVoid.BindList("descs", "id", "select * from t_行业信息 ", drop_hy); //DropList_SampleType.Text = ""; txt_Item.Text = ""; panel_Item.Visible = false; }
protected void SetButton() { if (MyStaVoid.isWrite(Request.Cookies["Cookies"].Values["uid"].ToString(), this.Request.Url.Segments[this.Request.Url.Segments.Length - 1].ToString())) { Button1.Enabled = true; } else { Button1.Enabled = false; } }
private void SetButton()//根据权限设置读写相关的按钮是否可用 { if (!MyStaVoid.isWrite(Request.Cookies["Cookies"].Values["uid"].ToString(), this.Request.Url.Segments[this.Request.Url.Segments.Length - 1].ToString())) { btn_Add.Visible = false; } else { btn_Add.Visible = true; } }
private void CleanAllText()//清空详细页面中所有的TextBox { MyStaVoid.BindList("ClassName", "ClassID", "select ClassID, ClassName from t_M_AnalysisMainClassEx", drop_wrw); ListItem li = new ListItem("请选择"); drop_wrw.Items.Add(li); drop_wrw.SelectedIndex = drop_wrw.Items.Count - 1; txt_SampleSource.Text = ""; panel_Item.Visible = false; txt_Item.Text = ""; }
private void CleanAllText()//清空详细页面中所有的TextBox { MyStaVoid.BindList("ClassName", "ClassID", "select ClassID, ClassName from t_M_AnalysisMainClassEx", drop_wrw); ListItem li = new ListItem("请选择"); drop_wrw.Items.Add(li); drop_wrw.SelectedIndex = drop_wrw.Items.Count - 1; txt_SampleSource.Text = ""; txt_Item.Text = ""; MyStaVoid.BindList("ItemName", "ItemID", "select ItemID,ItemName,ItemCode from t_M_ItemInfo order by ItemID", drop_itemtype); }
private void initial() { MyStaVoid.BindList("des", "id", "select rtrim(ClientName) des,id from t_M_ClientInfo", drop_area_query); //MyStaVoid.BindList("des", "id", "select rtrim(des) des,id from t_生产状态", drop_status); //MyStaVoid.BindList("des", "id", "select rtrim(des) des,id from t_行业信息", drop_industry); ListItem listsd = new ListItem("所有", "0"); //drp_sd.Items.Add(listsd); //drop_status.Items.Add(listsd); drop_area_query.Items.Add(listsd); drop_area_query.SelectedIndex = drop_area_query.Items.Count - 1; }
protected void SetButton() { if (!MyStaVoid.isWrite(Request.Cookies["Cookies"].Values["uid"].ToString(), this.Request.Url.Segments[this.Request.Url.Segments.Length - 1].ToString())) { btn_OKAnalysis.Enabled = false; } else { btn_OKAnalysis.Enabled = true; // btn_AddSample.Enabled = true; } }
protected void btn_Add_Click(object sender, EventArgs e) { panel_role.Visible = false; lbl_Type.Text = "添加"; txt_UserName.Text = ""; BindDrop(); Txt_pwd.Text = ""; drop_Level.SelectedValue = drop_UserLevel.SelectedValue; MyStaVoid.BindList("DepartName", "DepartID", "select * from t_M_DepartInfo order by DepartID ", drop_ThrSca_Name); btn_OK.Text = "确定"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "showAddEdit();", true); Query(); }
protected void grdvw_List_RowDeleting(object sender, GridViewDeleteEventArgs e) { string slevel = ""; txt_ReportID.Text = ""; if (grdvw_List.Rows[e.RowIndex].Cells[5].Text.Trim() != " ") { txt_ReportID.Text = grdvw_List.Rows[e.RowIndex].Cells[5].Text.Trim();//报告标识 } strReportName = grdvw_List.Rows[e.RowIndex].Cells[5].Text.Trim(); strReportId = grdvw_List.Rows[e.RowIndex].Cells[1].Text.Trim(); lbl_Type.Text = "样品列表"; txt_CreateDate.Text = grdvw_List.Rows[e.RowIndex].Cells[2].Text.Trim();//报告创建日期 //txt_itemname.Text = grdvw_List.Rows[e.NewEditIndex].Cells[4].Text.Trim(); //txt_itemname.ReadOnly = true; ListItem choose = new ListItem("请选择", "-1"); //txt_itemname.Text = grdvw_List.Rows[e.NewEditIndex].Cells[4].Text; drop_urgent.Text = ""; if (grdvw_List.Rows[e.RowIndex].Cells[8].Text != " ") { drop_urgent.Text = grdvw_List.Rows[e.RowIndex].Cells[8].Text; } drop_level.SelectedValue = "0"; if (grdvw_List.Rows[e.RowIndex].Cells[9].Text.Trim() != " " && grdvw_List.Rows[e.RowIndex].Cells[9].Text.Trim() != "") { slevel = grdvw_List.Rows[e.RowIndex].Cells[9].Text.Trim(); drop_level.SelectedValue = slevel; } MyStaVoid.BindList("ClientName", "id", "select * from t_M_ClientInfo order by id", DropList_client); string clientid = grdvw_List.Rows[e.RowIndex].Cells[6].Text; DropList_client.Items.Add(choose); DropList_client.Items.FindByValue(clientid).Selected = true; MyStaVoid.BindList("ItemName", "ItemID", "select * from t_M_ItemInfo order by ItemID", drop_ItemList); string itemtid = grdvw_List.Rows[e.RowIndex].Cells[3].Text; drop_ItemList.Items.Add(choose); drop_ItemList.Items.FindByValue(itemtid).Selected = true; if (grdvw_List.Rows[e.RowIndex].Cells[10].Text.Trim() != " " && grdvw_List.Rows[e.RowIndex].Cells[10].Text.Trim() != "") { txt_wtdepart.Text = grdvw_List.Rows[e.RowIndex].Cells[10].Text.Trim(); } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "showDetailAnalysis();", true); ReportSelectQuery(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region 初始化页面元素 MyStaVoid.BindList("LevelName", "LevelID", "select * from t_R_UserLevel where LevelID>" + Request.Cookies["Cookies"].Values["u_level"].ToString(), drop_UserLevel); grdvw_List.Caption = "<FONT style='WIDTH: 102.16%; COLOR: #2292DD;font-size:14pt; LINE-HEIGHT: 150%; FONT-FAMILY: 楷体_GB2312; HEIGHT: 35px'><b>角色列表</b></font>"; //SetButton(); #endregion SetButton(); Query(); } }
protected void SetButton() { if (!MyStaVoid.isWrite(Request.Cookies["Cookies"].Values["uid"].ToString(), this.Request.Url.Segments[this.Request.Url.Segments.Length - 1].ToString())) { Button_AddCatalog.Enabled = false; Panel1.Visible = false; Button_Delete.Visible = false; } else { Button_AddCatalog.Enabled = true; Panel1.Visible = true; Button_Delete.Visible = true; } }
// protected void Page_Load(object sender, EventArgs e) //{ // this.Title = "企业信息"; // if (!IsPostBack) // { // #region 初始化页面元素 // if (Request.QueryString["edit"] != null) // { // InitDropDownList("1"); // Editid = Request.QueryString["edit"].ToString(); // InitData(Editid); // txt_qymc.Enabled = false; // btn_Add.Text = "编 辑"; // AllTxtreadOnly(); // btn_print.Visible = true; // } // else // { // InitDropDownList(""); // AllTxtCanWrite(); // btn_print.Visible = false; // } // txt_createdate.Attributes.Add("OnFocus", "javascript:WdatePicker()"); // //txt_wstime.Attributes.Add("OnFocus", "javascript:WdatePicker()"); // //txt_grtime.Attributes.Add("OnFocus", "javascript:WdatePicker()"); // SetButton(); // #endregion // } //} private void InitDropDownList(string id)//清空详细页面中所有的TextBox { MyStaVoid.BindList("des", "id", "select rtrim(ClientName) des,id from t_M_ClientInfo", drp_sd); MyStaVoid.BindList("des", "id", "select rtrim(des) des,id from t_生产状态", drop_status); MyStaVoid.BindList("des", "id", "select rtrim(des) des,id from t_行业信息", drop_industry); ListItem listsd = new ListItem("请选择", "0"); drp_sd.Items.Add(listsd); drop_status.Items.Add(listsd); drop_industry.Items.Add(listsd); if (id == "") { drp_sd.SelectedValue = "0"; drop_status.SelectedValue = "0"; drop_industry.SelectedValue = "0"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region 初始化页面元素 SetTxt(); SetButton(); MyStaVoid.BindList("ClassName", "ClassID", "select * from t_M_AnalysisMainClassEx order by ClassID", dropList_type); MyStaVoid.BindList("ClassName", "ClassID", "select * from t_M_AnalysisMainClassEx order by ClassID", dropList_type_S); ListItem townList = new ListItem("请选择", ""); dropList_type_S.Items.Add(townList); dropList_type_S.SelectedValue = ""; grdvw_List.Caption = "<FONT style='WIDTH: 102.16%; COLOR: #2292DD;font-size:14pt; LINE-HEIGHT: 100%; FONT-FAMILY: 楷体_GB2312; HEIGHT: 35px'><b>分析项目管理</b></font>"; #endregion Query(); } }
protected void grdvw_List_RowEditing(object sender, GridViewEditEventArgs e) { lbl_Type.Text = "编辑"; strSelectedId = grdvw_List.Rows[e.NewEditIndex].Cells[6].Text; txt_name.Text = grdvw_List.Rows[e.NewEditIndex].Cells[2].Text; DataSet ds = new MyDataOp("select * from t_R_UserInfo,t_R_Role where t_R_UserInfo.RoleID=t_R_Role.RoleID and t_R_UserInfo.id='" + strSelectedId + "'").CreateDataSet(); MyStaVoid.BindList("DepartName", "DepartID", "select * from t_M_DepartInfo order by DepartID ", drop_ThrSca_Name); drop_ThrSca_Name.SelectedItem.Selected = false; drop_ThrSca_Name.Items.FindByValue(ds.Tables[0].Rows[0]["DepartID"].ToString()).Selected = true; txt_UserName.Text = ds.Tables[0].Rows[0]["UserID"].ToString(); if (drop_ThrSca_Name.SelectedValue.ToString().Trim() == "4" || drop_ThrSca_Name.SelectedValue.ToString().Trim() == "3") { panel_role.Visible = true; panel_a.Visible = false; lbtn_xk.Text = "+分析员角色设定"; btn_a_add.Text = "+分析员A角设定"; btn_b_add.Text = "+分析员B角设定"; panel_b.Visible = false; drop_type.SelectedValue = ds.Tables[0].Rows[0]["grouptype"].ToString(); ABRoleGroup(ds.Tables[0].Rows[0]["UserID"].ToString()); } else { panel_role.Visible = false; panel_a.Visible = false; panel_b.Visible = false; } BindDrop(); // MyStaVoid.BindList("LevelName", "LevelID", "select * from t_R_UserLevel where LevelID>'" + Request.Cookies["Cookies"].Values["u_level"].ToString() + "'", drop_Level); drop_Level.SelectedItem.Selected = false; drop_Level.Items.FindByValue(ds.Tables[0].Rows[0]["LevelID"].ToString()).Selected = true; // MyStaVoid.BindList("RoleName", "RoleID", "select * from t_R_Role where LevelID='" + ds.Tables[0].Rows[0]["LevelID"].ToString()+ "' order by RoleID ", drop_Role); drop_Role.SelectedItem.Selected = false; drop_Role.Items.FindByValue(ds.Tables[0].Rows[0]["RoleID"].ToString()).Selected = true; Txt_pwd.Text = ds.Tables[0].Rows[0]["PWD"].ToString(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "showAddEdit();", true); }
protected void btn_Add_Click(object sender, EventArgs e) { lbl_Type.Text = "添加"; btn_OK.Text = "确定"; txt_ReportID.Text = ""; MyStaVoid.BindList("ClientName", "id", "select * from t_M_ClientInfo order by id", DropList_client); ListItem choose = new ListItem("请选择", "-1"); DropList_client.Items.Add(choose); DropList_client.Items.FindByValue("-1").Selected = true; MyStaVoid.BindList("ItemName", "ItemID", "select * from t_M_ItemInfo order by ItemID", drop_ItemList); drop_ItemList.Items.Add(choose); drop_ItemList.Items.FindByValue("-1").Selected = true; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "showAddEdit();hiddenDetailAnalysis();", true); drop_urgent.Text = ""; Query(); }
protected void Page_Load(object sender, EventArgs e) { this.Title = "委托监测列表"; if (!IsPostBack) { #region 初始化页面 txt_StartTime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); txt_EndTime.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd'})"); //txt_StartTime.Attributes.Add("OnFocus", "javascript:calendar()"); //txt_EndTime.Attributes.Add("OnFocus", "javascript:calendar()"); txt_StartTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); txt_EndTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd"); MyStaVoid.BindList("name", "code", " select name,code from t_dictinf where type='status' order by code", drop_statusQuery); ListItem li = new ListItem("所有", ""); drop_statusQuery.Items.Add(li); drop_statusQuery.SelectedIndex = drop_statusQuery.Items.Count - 1; Query(0); #endregion } }
private void newDt() { dt_analysis = null; dt_analysis = new DataTable(); DataColumn dc6 = new DataColumn("ID"); DataColumn dc1 = new DataColumn("分析项目"); DataColumn dc2 = new DataColumn("ItemID"); DataColumn dc3 = new DataColumn("标准"); dt_analysis.Columns.Add((dc6)); dt_analysis.Columns.Add((dc1)); dt_analysis.Columns.Add((dc2)); dt_analysis.Columns.Add((dc3)); MyStaVoid.BindList("ItemName", "ItemID", "select ItemID,ItemName,ItemCode from t_M_ItemInfo order by ItemID", dropList_type_Query); ListItem li = new ListItem("所有", "-1"); dropList_type_Query.Items.Add(li); dropList_type_Query.SelectedValue = "-1"; }
protected void grdvw_List_RowEditing(object sender, GridViewEditEventArgs e) { CleanAllText(); lbl_Type.Text = "详细"; strSelectedId = grdvw_List.Rows[e.NewEditIndex].Cells[1].Text; strHyId = grdvw_List.Rows[e.NewEditIndex].Cells[6].Text; txt_SampleSource.Text = grdvw_List.Rows[e.NewEditIndex].Cells[3].Text; drop_wrw.SelectedValue = grdvw_List.Rows[e.NewEditIndex].Cells[4].Text; drop_bz.SelectedValue = grdvw_List.Rows[e.NewEditIndex].Cells[8].Text; MyStaVoid.BindList("bz", "id", "select t_hyClassParam.id,t_标准字典.bz+'('+t_hyClassParam.itemlist+')' as bz from t_hyClassParam inner join t_标准字典 on t_hyClassParam.bz=t_标准字典.id where hyid='" + strHyId + "'", drop_bz); txt_Item.Text = ""; string strsql = "select t_M_ANItemInf.id, AIName 分析项目, t_hyItem.itemid ItemID,t_hyItem.fw 标准 from t_hyItem inner join t_M_ANItemInf on t_M_ANItemInf.id=t_hyItem.itemid where pid='" + drop_bz.SelectedValue.ToString().Trim() + "'"; DataSet ds = new MyDataOp(strsql).CreateDataSet(); // MyStaVoid.BindList("bz", "id", "select t_hyClassParam.id,t_标准字典.bz+'('+t_hyClassParam.itemlist+')' as bz from t_hyClassParam inner join t_标准字典 on t_hyClassParam.bz=t_标准字典.id where hyid='" + strHyId + "'", drop_itemtype); drop_itemtype.SelectedValue = grdvw_List.Rows[e.NewEditIndex].Cells[9].Text.Trim(); txt_Item.Enabled = false; if (ds != null) { if (ds.Tables.Count > 0) { //DataColumn dc = new DataColumn("ID"); //ds.Tables[0].Columns.Add(dc); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { txt_Item.Text += dr["分析项目"].ToString() + ","; } grv_Item.DataSource = ds; grv_Item.DataBind(); } } } AllTxtreadOnly(); btn_OK.Text = "编辑"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "showAddEdit();", true); }
private void BindDrop() { MyStaVoid.BindList("LevelName", "LevelID", "select * from t_R_UserLevel where LevelID>'" + Request.Cookies["Cookies"].Values["u_level"].ToString() + "'", drop_Level); MyStaVoid.BindList("RoleName", "RoleID", "select * from t_R_Role where LevelID='" + drop_UserLevel.SelectedValue + "' order by RoleID ", drop_Role); //DataTable dt = itemObj.GetType(drop_type.SelectedValue.ToString()); //Repeater_A.DataSource = dt; //Repeater_A.DataBind(); //Repeater_B.DataSource = dt; //Repeater_B.DataBind(); //inGrv(dt); //grv_a.DataSource = dt; //grv_a.DataBind(); //dt_analysisA = null; //dt_analysisA = new DataTable(); //DataColumn dc1 = new DataColumn("id"); //DataColumn dc2 = new DataColumn("Standard"); //DataColumn dc3 = new DataColumn("Method"); //dt_analysisA.Columns.Add(dc1); //dt_analysisA.Columns.Add(dc2); //dt_analysisA.Columns.Add(dc3); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region 初始化页面元素 // dtItem = itemObj.GetItem(); MyStaVoid.BindList("LevelName", "LevelID", "select * from t_R_UserLevel where LevelID>'" + Request.Cookies["Cookies"].Values["u_level"].ToString() + "'", drop_UserLevel); ////-----FirstScale---------- //lbl_FirSca_Title.Text = MyStaVoid.getScaleName(2) + "名称:"; ////-----SecondScale--------- //lbl_SecSca_Title.Text = MyStaVoid.getScaleName(3) + "名称:"; ////-----ThirdScale---------- //lbl_ThrSca_Title.Text = "所属部门:"; //------Other------------- grdvw_List.Caption = "<FONT style='WIDTH: 102.16%; COLOR: #2292DD;font-size:14pt; LINE-HEIGHT: 150%; FONT-FAMILY: 楷体_GB2312; HEIGHT: 35px'><b>用户管理</b></font>"; SetButton(); #endregion Query(); } }
protected void drop_Level_SelectedIndexChanged(object sender, EventArgs e) { MyStaVoid.BindList("RoleName", "RoleID", "select * from t_R_Role where LevelID='" + drop_Level.SelectedValue + "'", drop_Role); Query(); }
protected void grdvw_List_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { //修改字段标题 //e.Row.Cells[2].Text = "车牌号"; //e.Row.Cells[3].Text = "限载人数"; ////添加按钮列的标题 //TableCell tabcHeaderEdit = new TableCell(); //if (Request.Cookies["Cookies"].Values["u_purview"].ToString().Substring(3, 1) == "0") //{ // tabcHeaderEdit.Text = "详细"; //} //else // tabcHeaderEdit.Text = "编辑"; //tabcHeaderEdit.BackColor = System.Drawing.Color.FromArgb(227, 239, 255); //tabcHeaderEdit.Width = 60; //e.Row.Cells.Add(tabcHeaderEdit); //添加按钮列的标题 TableCell tabcHeaderDetail = new TableCell(); tabcHeaderDetail.Text = "下载"; tabcHeaderDetail.BackColor = System.Drawing.Color.FromArgb(227, 239, 255); tabcHeaderDetail.Width = 60; e.Row.Cells.Add(tabcHeaderDetail); TableCell tabcHeaderDel = new TableCell(); tabcHeaderDel.Text = "删除"; tabcHeaderDel.BackColor = System.Drawing.Color.FromArgb(227, 239, 255); tabcHeaderDel.Width = 30; e.Row.Cells.Add(tabcHeaderDel); } if (e.Row.RowType == DataControlRowType.DataRow) { //鼠标移动到每项时颜色交替效果 e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='';"); e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#00ffee'"); int id = e.Row.RowIndex + 1; e.Row.Cells[0].Text = id.ToString(); ////手动添加详细和删除按钮 //TableCell tabcEdit = new TableCell(); //tabcEdit.Width = 60; //tabcEdit.Style.Add("text-align", "center"); //ImageButton ibtnEdit = new ImageButton(); //ibtnEdit.ImageUrl = "~/Images/Detail.gif"; //ibtnEdit.CommandName = "Edit"; //tabcEdit.Controls.Add(ibtnEdit); //e.Row.Cells.Add(tabcEdit); //手动添加详细和删除按钮 TableCell tabcDetail = new TableCell(); tabcDetail.Width = 60; tabcDetail.Style.Add("text-align", "center"); ImageButton ibtnDetail = new ImageButton(); ibtnDetail.ImageUrl = "~/Images/Detail.gif"; ibtnDetail.CommandName = "Select"; tabcDetail.Controls.Add(ibtnDetail); e.Row.Cells.Add(tabcDetail); TableCell tabcDel = new TableCell(); tabcDel.Width = 30; tabcDel.Style.Add("text-align", "center"); ImageButton ibtnDel = new ImageButton(); ibtnDel.ImageUrl = "~/Images/Delete.gif"; ibtnDel.CommandName = "Delete"; ibtnDel.Attributes.Add("OnClick", "if(!confirm('确定删除该项吗?')) return false;"); //if (Int16.Parse(Request.Cookies["Cookies"].Values["u_level"].ToString()) >6 || Request.Cookies["Cookies"].Values["u_purview"].ToString().Substring(0, 1) == "0") if (!MyStaVoid.isWrite(Request.Cookies["Cookies"].Values["uid"].ToString(), this.Request.Url.Segments[this.Request.Url.Segments.Length - 1].ToString())) { ibtnDel.Visible = false; //ibtnEdit.Visible = false; } else { tabcDel.Visible = true; //ibtnEdit.Visible = true; } tabcDel.Controls.Add(ibtnDel); e.Row.Cells.Add(tabcDel); } if (e.Row.RowType != DataControlRowType.Pager) { if (Request.Cookies["Cookies"].Values["u_purview"].ToString().Substring(3, 1) == "0") { e.Row.Cells[4].Visible = false; } else { e.Row.Cells[4].Visible = true; } for (int i = 5; i < e.Row.Cells.Count - 2; i++) { e.Row.Cells[i].Visible = false;//绑定数据后,隐藏0列 } } }
private void BindDrop() { MyStaVoid.BindList("LevelName", "LevelID", "select * from t_R_UserLevel where LevelID>'" + Request.Cookies["Cookies"].Values["u_level"].ToString() + "'", drop_Level); MyStaVoid.BindList("RoleName", "RoleID", "select * from t_R_Role where LevelID='" + drop_UserLevel.SelectedValue + "' order by RoleID ", drop_Role); }