protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //项目类别 ProjectType.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56); ProjectType.DataTextField = "ClassName"; ProjectType.DataValueField = "ClassName"; ProjectType.DataBind(); ProjectType.Items.Insert(0, new ListItem("选择类型", ""));; //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); ClassName.Items.Insert(0, new ListItem("选择专业", "")); DesignTaskID.Items.Insert(0, new ListItem("选择任务", "")); //如果是通过卷册任务执行点过来的话 int taskid = WebCommon.Public.ToInt(Request.QueryString["taskid"]); if (taskid > 0) { WebModels.Tbl_DesignTask task = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(taskid); ProjectID.Items.Insert(0, new ListItem(task.ProjectName, task.ProjectID.ToString())); ClassName.SelectedValue = task.ClassName1; DesignTaskID.Items.Insert(0, new ListItem(task.DT_SheJiRen, task.ID.ToString())); } else { ProjectID.Items.Insert(0, new ListItem("选择项目", "")); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定项目 ProjectID.DataSource = WebBLL.Tbl_ProjectManager.GetTbl_ProjectAll(); ProjectID.DataTextField = "ProjectName"; ProjectID.DataValueField = "ID"; ProjectID.DataBind(); ProjectID.Items.Insert(0, new ListItem("其他项目", "其他项目")); //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); ClassName.Items.Insert(0, new ListItem("选择专业", "")); WorkType.Items.Add(new ListItem("司令图工日", "司令图工日")); WorkType.Items.Add(new ListItem("辅助工日", "辅助工日")); WorkType.Items.Add(new ListItem("归档工日", "归档工日")); WorkType.Items.Add(new ListItem("出差工日", "出差工日")); WorkType.Items.Add(new ListItem("投标工日", "投标工日")); WorkType.Items.Add(new ListItem("初设工日", "初设工日")); WorkType.Items.Add(new ListItem("咨询工日", "咨询工日")); WorkType.Items.Add(new ListItem("其他", "其他")); //遍历绑定人员列表 WebBLL.Tbl_UserManager.GetUsersByListBox(NodeUser); UserName.Text = WebCommon.Public.GetUserName(); UserName.Enabled = false; } }
private void getClass() { string da = (string)Session["classname"]; string userclass = (string)Session["userclass"]; if (da.Trim() == "系统管理员") { string con = ConfigurationSettings.AppSettings["np"]; SqlConnection myConnection = new SqlConnection(con); myConnection.Open(); SqlCommand cla = myConnection.CreateCommand(); cla.CommandText = "select classname from Class"; SqlDataAdapter selClassAll = new SqlDataAdapter(cla); DataSet ds = new DataSet(); selClassAll.Fill(ds, "classname"); ClassName.DataSource = ds.Tables["classname"].DefaultView; ClassName.DataTextField = "classname"; ClassName.DataValueField = "classname"; ClassName.DataBind(); myConnection.Close(); } else { ListItem d = new ListItem(userclass, userclass); ClassName.Items.Add(d); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //删除 if (Request.QueryString["limit"] == "del") { int ids = Convert.ToInt32(Request.QueryString["id"].ToString()); int count = WebCommon.Public.DataTableDel("Tbl_ProjectDesigner", "id in(" + ids + ")"); if (count > 0) { WebCommon.Script.AlertAndGoBack("删除成功!"); //ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('删除成功!');", true); } else { WebCommon.Script.AlertAndGoBack("删除失败!"); } } //项目信息 Bind(); //该项目主设列表 BindList(); //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); ClassName.Items.Insert(0, new ListItem("选择专业", "")); UserName.Items.Insert(0, new ListItem("选择主设", "")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定项目 ProjectID.DataSource = WebBLL.Tbl_ProjectManager.GetTbl_ProjectAll(); ProjectID.DataTextField = "ProjectName"; ProjectID.DataValueField = "ID"; ProjectID.DataBind(); ProjectID.Items.Insert(0, new ListItem("选择项目", "")); //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); ClassName.Items.Insert(0, new ListItem("选择专业", "")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //设置只读权限 if (Request.QueryString["type"] == "read") { btn_submit.Visible = false; ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "$(function(){$('input').attr('readonly', 'readonly');$('select').attr('disabled', 'true');$('textarea').attr('readonly', 'readonly');});", true); } //项目类型 ProjectID.DataSource = WebBLL.Tbl_ProjectManager.GetTbl_ProjectAll(); ProjectID.DataTextField = "ProjectName"; ProjectID.DataValueField = "ID"; ProjectID.DataBind(); //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); Bind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //判断当前人是不是设计师权限 if (!WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_DesignLimit.Contains("设计人")) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('您不是设计人没有提资权限!');window.external.close();", true); btn_submit.Visible = false; } //项目类型 ProjectType.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56); ProjectType.DataTextField = "ClassName"; ProjectType.DataValueField = "ClassName"; ProjectType.DataBind(); ProjectType.Items.Insert(0, new ListItem("选择项目类别", "")); ProjectID.Items.Insert(0, new ListItem("选择项目", "")); //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); ClassName.Items.Insert(0, new ListItem("选择专业", "")); lishitizi.Visible = false; string cfromStr = WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_Specialty; foreach (string str in cfromStr.Split(',')) { if (str != "") { ClassNameFrom.Items.Insert(0, str); } } ClassNameFrom.SelectedIndex = 0; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //项目ID ProjectID.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56); ProjectID.DataTextField = "ClassName"; ProjectID.DataValueField = "ClassName"; ProjectID.DataBind(); ProjectID.Items.Insert(0, new ListItem("选择项目类别", "")); //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); ClassName.Items.Insert(0, new ListItem("选择专业", "")); //遍历绑定人员列表 //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DesignManager); //DesignManager.Items.Insert(0, new ListItem("选择设总", "")); ////遍历绑定人员列表 //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DesignMain); //DesignMain.Items.Insert(0, new ListItem("选择主设", "")); //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_SheJiRen); //DT_SheJiRen.Items.Insert(0, new ListItem("选择审计人", "")); //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_JiaoDuiRen); //DT_JiaoDuiRen.Items.Insert(0, new ListItem("选择校对人", "")); //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_ShenHeRen); //DT_ShenHeRen.Items.Insert(0, new ListItem("选择审核人", "")); //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_ShenDingRen); //DT_ShenDingRen.Items.Insert(0, new ListItem("选择审定人", "")); //WebBLL.Tbl_UserManager.GetUsersByDropDownList(DT_HeZhunRen); //DT_HeZhunRen.Items.Insert(0, new ListItem("选择核准人", "")); ////卷册 //ClassName3.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(60); //ClassName3.DataTextField = "ClassName"; //ClassName3.DataValueField = "ClassName"; //ClassName3.DataBind(); //ClassName3.Items.Insert(0, new ListItem("选择卷册", "")); //删除 if (Request.QueryString["limit"] == "del") { int ids = Convert.ToInt32(Request.QueryString["id"].ToString()); int count = WebCommon.Public.DataTableDel("Tbl_DesignTask", "id in(" + ids + ")"); if (count > 0) { //ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('删除成功!');", true); } else { WebCommon.Script.AlertAndGoBack("删除失败!"); } } //如果是通过任务明细连接过来 int projectid = WebCommon.Public.ToInt(Request.QueryString["ProjectID"]); if (projectid > 0) { ProjectName.SelectedValue = projectid.ToString(); WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(Convert.ToInt32(Request.QueryString["ProjectID"])); ProjectName.Items.Insert(0, new ListItem(project.ProjectName, Request.QueryString["ProjectID"])); ProjectID.SelectedValue = project.ProjectTypes; ProjectNo.Value = project.ProjectNo; ProjectName.Enabled = false; ProjectID.Enabled = false; ProjectNo.Attributes.Add("readonly", "readonly"); //设总默认 DesignManager.Items.Insert(0, new ListItem(project.ProjectMainDesigner, project.ProjectMainDesigner)); DesignManager.Enabled = false; //主设默认 //DesignMain.Items.Insert(0, new ListItem(WebCommon.Public.GetUserName(), WebCommon.Public.GetUserName())); //DesignMain.Enabled = false; DesignMain.DataSource = WebBLL.Tbl_ProjectDesignerManager.GetDataTableByPage(50, 1, "projectid=" + ProjectName.SelectedValue + " and username in (select distinct(designmain) from tbl_designtask where status='任务审批' and projectid=" + project.ID.ToString() + ")", ""); DesignMain.DataTextField = "UserName"; DesignMain.DataValueField = "ClassName"; DesignMain.DataBind(); DesignMain.Items.Insert(0, new ListItem("选择主设", "")); //专业默认 //string classname = WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_Specialty; //if (WebCommon.Public.ToString(Request.QueryString["ClassName"]) != "") classname = Request.QueryString["ClassName"]; //ClassName.Items.Insert(0, new ListItem(classname, classname)); ClassName.Enabled = false; //卷默认 //ClassName1.DataSource = WebBLL.Tbl_ClassManager.GetDataTableByPage(10, 1, "parentid=(select top 1 id from tbl_class where classname='" + classname + "')", "id desc"); //ClassName1.DataTextField = "ClassName"; //ClassName1.DataValueField = "ID"; //ClassName1.DataBind(); ClassName1.Items.Insert(0, new ListItem("选择卷", "")); ClassName1.Enabled = false; //绑定当前任务 BindList(); } } }
private void getArticle() { string con = ConfigurationSettings.AppSettings["np"]; SqlConnection conn = new SqlConnection(con); conn.Open(); try { SqlDataAdapter myCommand = new SqlDataAdapter(); myCommand.SelectCommand = new SqlCommand("select * from Article where articleid=@articleid", conn); SqlParameter id = myCommand.SelectCommand.Parameters.Add("@articleid", SqlDbType.BigInt); id.Value = Request["articleid"]; DataSet ds = new DataSet(); myCommand.Fill(ds, "Article"); DataRow dr; dr = ds.Tables["Article"].Rows[0]; string content = (string)dr["content"]; //Body.Value = Server.HtmlDecode(content); Body.Value = unFormatString(content); string title = (string)dr["title"]; Title.Text = title; string classname = (string)dr["classname"]; string writer = (string)dr["writer"]; Author.Text = writer; string source = (string)dr["source"]; Source.Text = source; if (Convert.IsDBNull(dr[10]) != true) { string arpic = (string)dr["artpic"]; Session["artpic"] = arpic; Image1.ImageUrl = arpic; string pictitle = (string)dr["pictitle"]; TextBox1.Text = pictitle; } string da = (string)Session["classname"]; if (da.Trim() == "系统管理员") { SqlDataAdapter selClassAll = new SqlDataAdapter(); selClassAll.SelectCommand = new SqlCommand("select * from Class", conn); DataSet dt = new DataSet(); selClassAll.Fill(dt, "ClassName"); ClassName.DataSource = dt; ClassName.DataTextField = "classname"; ClassName.DataValueField = "classname"; ClassName.DataBind(); int i = 0; foreach (ListItem li in ClassName.Items) { if (li.Text.Trim() == classname.Trim()) { li.Selected = true; } i += 1; } } else { ListItem d = new ListItem(classname, classname); ClassName.Items.Add(d); } conn.Close(); } catch (SqlException e) { Response.Write("Exception in Main: " + e.Message); } }