//保存 protected void Button_Save_Click(object sender, EventArgs e) { string ls_tip = "保存成功!"; try { string[] lv_jsrsysname, lv_jsrcnname;//接收人系统名、中文名 lv_jsrsysname = this.f_ReceivesysNameList.Value.ToString().Split('+'); lv_jsrcnname = this.f_ReceiveChNameList.Value.ToString().Split('+'); HyoaClass.Hyoa_sms Hyoa_sms = new HyoaClass.Hyoa_sms(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dt; for (int i = 0; i < lv_jsrsysname.Length; i++) { Hyoa_sms.ID = Hyoa_global.GetRandom(); Hyoa_sms.DOCID = Hyoa_global.GetRandom(); Hyoa_sms.hy_fsrid = this.txtdjrid.Value; Hyoa_sms.hy_fsrname = this.f_SendChName.Text; Hyoa_sms.hy_fsrsjh = this.f_SendMobileNo.Text; Hyoa_sms.hy_jsrid = lv_jsrsysname[i]; Hyoa_sms.hy_jsrname = lv_jsrcnname[i]; dt = Hyoa_user.Getuserallinfobyloginid(lv_jsrsysname[i]); if (dt.Rows.Count > 0) { Hyoa_sms.hy_jsrsjh = dt.Rows[0]["hy_mobile"].ToString(); } else { Hyoa_sms.hy_jsrsjh = lv_jsrsysname[i]; } Hyoa_sms.hy_createtime = System.DateTime.Now.ToString(); Hyoa_sms.hy_from = ""; Hyoa_sms.hy_content = this.f_smsContents.Text; Hyoa_sms.hy_isnowsend = 1; Hyoa_sms.hy_takedate = ""; Hyoa_sms.hy_taketime = ""; Hyoa_sms.hy_state = 0; Hyoa_sms.hy_tableid = "Mudelsms"; Hyoa_sms.Insert(); } } catch { } finally { //处理完成后的提示及跳转 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>"); } } }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_sms Hyoa_sms = new HyoaClass.Hyoa_sms(); String[] v_uids = this.txtuids.Value.Split(','); for(var i=0;i<v_uids.Length;i++) { if (v_uids[i] != "") { //this.Response.Write("<script>alert('aaa')</script>"); Hyoa_sms.ID = v_uids[i]; Hyoa_sms.Delete(); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
private void DataPlay(int PageNo) { //判断当前用户是否有新建删除权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) //{ // this.tddeldoc.Visible = true; //删除 //} //else //{ // this.tddeldoc.Visible = false; //删除 //} //得到当前页号 this.curpage.Text = PageNo.ToString(); HyoaClass.Hyoa_sms Hyoa_sms = new HyoaClass.Hyoa_sms(); DataTable dt; dt = Hyoa_sms.Getsmsbyfsrid_yf(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(); }