private void BindData() { this.GridView1.EnableViewState = false; this.GridView1.DataSource = Bmk.Find(p => p.bj == this.Bj, "bmxh"); this.GridView1.DataBind(); this.GridView1.Caption = string.Format("鹿城实验中学2011级{0}班中考志愿确认表(总共{0}人)", this.GridView1.Rows.Count); }
/// <summary> /// 生成报名序号 /// </summary> /// <param name="xuexiao"></param> /// <param name="kelei"></param> /// <param name="makeType"></param> private void MakeBmxh(string xuexiao, string kelei, string makeType) { if (makeType == "4") { int xh = 1;//序号 var list1 = Bmk.Find(p => p.hk != "88" && p.hk != "99", "class,xstbh"); foreach (var bmk in list1) { bmk.bmxh = string.Format("{0}{1}{2}", xuexiao, kelei, xh.ToString().PadLeft(4, '0')); bmk.Save(); xh++; } var list2 = Bmk.Find(p => p.hk == "88" || p.hk == "99", "class,xstbh"); foreach (var bmk in list2) { bmk.bmxh = string.Format("{0}{1}{2}", xuexiao, kelei, xh.ToString().PadLeft(4, '0')); bmk.Save(); xh++; } this.MessageBox("OK"); } else { MessageBox("未实现"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var list = Bmk.Find(p => p.bj == this.Bj, "bmxh"); if (list.Count > 35) { this.GridView1.RowStyle.Height = (Unit)23; } else { this.GridView1.RowStyle.Height = (Unit)28; } this.GridView1.DataSource = list; this.GridView1.DataBind(); this.tc1 = 0; this.tc2 = 0; this.tc3 = 0; this.tc4 = 0; this.tc5 = 0; this.tc6 = 0; this.tc7 = 0; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.GridView1.DataSource = Bmk.Find(p => p.bj == this.Bj, "bmxh"); this.GridView1.DataBind(); } }
private void BindData() { this.GridView1.EnableViewState = false; Condition con = null; string orderStr = ""; switch (this.ddlHk.SelectedValue) { case "1": con &= CK.K["hk"] == "25"; break; case "2": con &= CK.K["hk"] != "25"; con &= CK.K["hk"] != "88"; con &= CK.K["hk"] != "99"; break; case "3": con &= (CK.K["hk"] == "88" | CK.K["hk"] == "99"); break; default: break; } if (this.ddlSyqk.SelectedIndex > 0) { con &= CK.K["syqk"] == this.ddlSyqk.SelectedValue; } if (this.ddlBj.SelectedIndex != this.ddlBj.Items.Count - 1) { con &= CK.K["class"] == this.ddlBj.SelectedValue; } switch (this.ddlOrder.SelectedValue) { case "0": orderStr = "xstbh"; break; case "1": orderStr = "bmxh"; break; case "2": orderStr = "hk,xstbh"; break; default: orderStr = "hk,xstbh"; break; } this.GridView1.DataSource = Bmk.Find(con, orderStr); this.GridView1.DataBind(); lblMsg.Text = string.Format("总共{0}人", this.GridView1.Rows.Count); }
private void BindData() { if (this.ddlBj.SelectedIndex == this.ddlBj.Items.Count - 1) { this.GridView1.DataSource = Bmk.Find(Condition.Empty, "bmxh"); // Bmk.Find(p => p.bj == this.Bj); } else { this.GridView1.DataSource = Bmk.Find(p => p.bj == this.ddlBj.SelectedValue, "bmxh"); } this.GridView1.DataBind(); lblMsg.Text = string.Format("总共{0}人", this.GridView1.Rows.Count); }
protected void btnTy_Click(object sender, EventArgs e) { var list = Bmk.Find(Condition.Empty); foreach (var item in list) { if (item.ty.IsNullOrEmpty()) { item.ty = "0"; item.Save(); } } this.MessageBox("OK"); }
protected void btnBatchSeting_Click(object sender, EventArgs e) { var list = Bmk.Find(Condition.Empty); foreach (var item in list) { if (item.byxxdm.IsNullOrEmpty()) { item.byxxdm = this.txtByxxdm.Text; item.byxxmc = this.txtByxxmc.Text; item.Save(); } } this.MessageBox("OK"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.GridView1.DataSource = Bmk.Find(Condition.Empty, "bmxh"); this.GridView1.DataBind(); this.tc1 = 0; this.tc2 = 0; this.tc3 = 0; this.tc4 = 0; this.tc5 = 0; this.tc6 = 0; this.tc7 = 0; } }
private void BindData() { this.GridView1.Columns[3].Visible = this.Xm == "km61"; this.GridView1.Columns[4].Visible = this.Xm == "km62"; this.GridView1.Columns[5].Visible = this.Xm == "km63"; this.GridView1.Columns[6].Visible = this.Xm == "km71"; this.GridView1.Columns[7].Visible = this.Xm == "km72"; this.GridView1.Columns[8].Visible = this.Xm == "km73"; this.GridView1.Columns[9].Visible = this.Xm == "km74"; this.GridView1.Columns[10].Visible = this.Xm == "km81"; this.GridView1.DataSource = Bmk.Find(p => p.bj == this.Bj); this.GridView1.DataBind(); }
private void BindData() { hlPrint.NavigateUrl = string.Format("frmZhiyuanListPrint.aspx?bj={0}", this.ddlBj.SelectedValue); hlPrint.Target = "_blank"; this.GridView1.EnableViewState = false; if (this.ddlBj.SelectedIndex == this.ddlBj.Items.Count - 1) { this.GridView1.DataSource = Bmk.Find(Condition.Empty, "bmxh"); // Bmk.Find(p => p.bj == this.Bj); } else { this.GridView1.DataSource = Bmk.Find(p => p.bj == this.ddlBj.SelectedValue, "bmxh"); } this.GridView1.DataBind(); lblMsg.Text = string.Format("总共{0}人", this.GridView1.Rows.Count); }
/// <summary> /// 邮政编码为空设为 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnPost_Click(object sender, EventArgs e) { if (this.txtPost.Text.Length != 6) { this.MessageBox("邮政编码必须为6位"); return; } var list = Bmk.Find(Condition.Empty); foreach (var item in list) { if (item.post.Length != 6) { item.post = this.txtPost.Text; item.post = this.txtPost.Text; item.Save(); } } this.MessageBox("OK"); }
protected void btnPwd_Click(object sender, EventArgs e) { PasswordGenerator pg = new PasswordGenerator(); pg.ExcludeSymbols = true; pg.Exclusions = "0oABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$^*()-_=+[]{}\\|;:'\",./"; pg.Maximum = 10; pg.Minimum = 6; var list = Bmk.Find(Condition.Empty); foreach (var stu in list) { string xh = stu.xstbh.Trim(); MembershipUser user = Membership.GetUser(xh); if (user != null) { string oldPwd = user.ResetPassword(); stu.Password = pg.Generate(); stu.Save(); user.ChangePassword(oldPwd, stu.Password.Trim()); if (Roles.IsUserInRole(xh, "Students") == false) { Roles.AddUserToRole(xh, "Students"); } } else { stu.Password = pg.Generate(); stu.Save(); Membership.CreateUser(xh, stu.Password.Trim()); if (Roles.IsUserInRole(xh, "Students") == false) { Roles.AddUserToRole(xh, "Students"); } } } this.BindData(); }
protected void btnInit_Click(object sender, EventArgs e) { var list = Bmk.Find(Condition.Empty); foreach (var bmk in list) { if (bmk.tcxm.Contains("2")) { Youyong youyong = Youyong.FindOne(p => p.bmxh == bmk.bmxh); if (youyong == null) { youyong = new Youyong(); } youyong.bmxh = bmk.bmxh; youyong.xm = bmk.xm; youyong.xb = bmk.xb; youyong.Save(); } } this.Succeed("游泳学生数据初始化成功"); CountRenshu(); }
protected void btnJsonExport_Click(object sender, EventArgs e) { var bmkList = Bmk.Find(Condition.Empty); Download(JsonConvert.SerializeObject(bmkList)); }
private void BindData() { this.GridView1.DataSource = Bmk.Find(p => p.bj == this.Bj, p => p.bmxh); this.GridView1.DataBind(); }
private string LoadAdd() { var bmkList = Bmk.Find(Condition.Empty); return(JsonConvert.SerializeObject(bmkList)); }