protected void DataGrid1_ItemCommand1(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); ZwTpOperator.Delete(id); WebTools.Alert(this, "删除成功!"); this.ProcedurePager1.Changed = true; } }
protected void btnAdd_Click(object sender, EventArgs e) { /* * ZwTpObject tp = new ZwTpObject(); * tp.Approver = "test"; * tp.ApproveTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); * tp.IdCard = this.txtIdCardInput.Text.Trim(); * tp.Name = "testname"; * tp.School ="testschool"; * tp.Type = this.DropDownList1.Text; * ZwTpOperator.Create(tp); */ // TempStudentInfo info=DrvQueryHelper.QueryStudent(WholeWebConfig.Glbm, this.txtIdCard.Text.Trim()); FpStudentObject f = new FpStudentObject(); f.IDCARD = this.txtIdCardInput.Text; FpStudentObject info = SimpleOrmOperator.Query <FpStudentObject>(f.IDCARD); // if (info == null || info.name == null || info.name.Length == 0) if (info == null) { WebTools.Alert(this, "未找到该学员在本车管所报名的信息!"); return; } else { ZwTpObject tp = new ZwTpObject(); tp.Approver = this.Operator.OperatorName; tp.ApproveTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); tp.IdCard = this.txtIdCardInput.Text.Trim(); tp.Name = info.NAME; //tp.School = info.jxmc; tp.Type = this.DropDownList1.SelectedItem.Text; ZwTpOperator.Create(tp); this.btnSearch_Click(null, null); info.STATUE = Convert.ToInt32(DropDownList1.SelectedValue); if (ZwTpOperator.Update(info) == true) { WebTools.Alert(this, "特批成功!"); return; } else { WebTools.Alert(this, "特批失败!"); return; } this.btnSearch_Click(null, null); } }