protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../../login.aspx"); string uid = ""; if (this.Session["hyuid"].ToString() != null) uid = this.Session["hyuid"].ToString(); HyoaClass.Hyoa_post Hyoa_post = new HyoaClass.Hyoa_post(); DataTable dt = Hyoa_post.Getpostbyuseridandtype(uid, "科研管理信息系统"); if (dt.Rows.Count > 0) { this.username.Value = dt.Rows[0]["userid"].ToString(); //this.Response.Write("<script>alert('" + Hyoa_post.Decrypt(dt.Rows[0]["pwd"].ToString()) + "');</script>"); this.passwordhidden.Value = Hyoa_post.Decrypt(dt.Rows[0]["pwd"].ToString()).ToString(); } //if (user.mailpwd != "" && user.mailpwd !=null) //{ // this.dec_password.Value = JpUsers.Decrypt(user.mailpwd); //} } }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_post Hyoa_post = new HyoaClass.Hyoa_post(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { Hyoa_post.ID = v_uids[i]; Hyoa_post.Delete(); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_post Hyoa_post = new HyoaClass.Hyoa_post(); if (this.txtop.Value == "add") { Hyoa_post.ID = Hyoa_global.GetRandom(); Hyoa_post.hy_userid = this.Session["hyuid"].ToString(); Hyoa_post.userid = this.txtuserid.Value; Hyoa_post.pwd = Hyoa_post.Encrypt(this.txtpwd.Value); Hyoa_post.hy_type = this.ddltypename.SelectedValue; Hyoa_post.Insert(); } else { Hyoa_post.ID = this.txtdocid.Value; Hyoa_post.hy_userid = this.Session["hyuid"].ToString(); Hyoa_post.userid = this.txtuserid.Value; Hyoa_post.pwd = Hyoa_post.Encrypt(this.txtpwd.Value); Hyoa_post.hy_type = this.ddltypename.SelectedValue; Hyoa_post.Update(); } //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } }
private void DataPlay() { //是否启用 this.ddltypename.Items.Insert(0, "宁波局OA"); //this.ddltypename.Items.Insert(1, "科研管理信息系统"); this.ddltypename.Items.Insert(1, "大榭局OA"); this.ddltypename.Items.Insert(2, "宁波局人事测评"); //模块编号 if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 this.btn_submit.Visible = true; //保存 //旧文档 if (this.Request.QueryString["op"] == "modify") { if (this.Request.QueryString["id"] != null) { //根据id得到信息 this.txtdocid.Value = this.Request.QueryString["id"].ToString(); HyoaClass.Hyoa_post Hyoa_post = new HyoaClass.Hyoa_post(); DataTable dt = Hyoa_post.Getpost(this.txtdocid.Value); if (dt.Rows.Count > 0) { this.ddltypename.SelectedValue = dt.Rows[0]["hy_type"].ToString(); this.txtuserid.Value = dt.Rows[0]["userid"].ToString(); this.txtpwd.Value = Hyoa_post.Decrypt(dt.Rows[0]["pwd"].ToString()); } dt.Clear(); } } } }
private void DataPlay(int PageNo) { this.tdnewdoc.Visible = true; //新建 this.tddeldoc.Visible = true; //删除 //得到当前页号 this.curpage.Text = PageNo.ToString(); HyoaClass.Hyoa_post Hyoa_post = new HyoaClass.Hyoa_post(); DataTable dt; dt = Hyoa_post.Getpostbyhy_userid(this.Session["hyuid"].ToString()); DataTable tempTable = dt.Clone(); for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); }