//更新案卷信息 protected void Button1_Click(object sender, EventArgs e) { Hashtable ht = new Hashtable(); foreach (string item in arr0) { ht[item] = Util.GetControlValue(this.ajnum.Parent.FindControl(item)); } bool check = true; ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// if (check) { try { DA_AnJuanBU anjuan1 = new DA_AnJuanBU(); anjuan1.UpdateAnJuanData(Request["id"], ht); anjuan1.Close(); string url1 = Application["root"] + "/DangAn/AnJuanWeiHu.aspx"; PubComm.ShowInfo("操作提示:更新资料成功!", Request.RawUrl); } catch { Util.alert(this.Page, "错误提示:更新案卷数据失败,可能的原因是数据类型有错误!"); } } }
//返回案卷信息 protected void Button2_Click(object sender, EventArgs e) { DA_AnJuanBU anjuan1 = new DA_AnJuanBU(); string id = anjuan1.GetIdByAjnum(this.ajnum.Text); Response.Redirect("AnJuanDetailEdit.aspx?id=" + id); anjuan1.Close(); }
private void BindData2() { List <SearchField> list1 = (List <SearchField>)ViewState["SearchCondition2"]; DA_AnJuanBU anjuan2 = new DA_AnJuanBU(); this.GridView1.DataSource = anjuan2.GetSearchResult_file(list1); this.GridView1.DataBind(); anjuan2.Close(); }
private void SetControlData() { if (Request["id"] != null) { string id = Request["id"]; DA_AnJuanBU aj2 = new DA_AnJuanBU(); DataSet ds = aj2.GetDetailByID1(id); aj2.Close(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < arr0.Length; i++) { Util.SetControlValue(this.ajnum.Parent.FindControl(arr0[i]), ds.Tables[0].Rows[0][arr0[i]]); } if (ds.Tables[0].Rows[0]["yjtime"] != DBNull.Value) { this.yjtime.Text = DateTime.Parse(ds.Tables[0].Rows[0]["yjtime"].ToString()).ToString("yyyy-MM-dd"); } if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value) { this.time0.Text = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd"); } if (ds.Tables[0].Rows[0]["yjdanwei"] != DBNull.Value && ds.Tables[0].Rows[0]["yjdanwei"].ToString().Trim() != "") { this.ajstatus.Text = "已移交"; this.Button2.Visible = false; } else { this.ajstatus.Text = ""; } U_ZCBU zc1 = new U_ZCBU(); DataSet ds1 = zc1.GetDepartAndZeren(this.ajname.Text); zc1.Close(); if (ds1.Tables[0].Rows.Count > 0) { this.depart.Text = ds1.Tables[0].Rows[0]["depart"].ToString(); this.zeren.Text = ds1.Tables[0].Rows[0]["zeren"].ToString(); } ds1.Dispose(); } ds.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string ajid = Request.QueryString["ajid"]; DA_AnJuanBU anjuan1 = new DA_AnJuanBU(); DataSet ds = anjuan1.GetDetailByID1(ajid); DataRow dr = ds.Tables[0].Rows[0]; if (dr["ajnum"] != DBNull.Value) { this.ajnum.Text = dr["ajnum"].ToString(); } anjuan1.Close(); } }
//提交--移交案卷 protected void Button1_Click(object sender, EventArgs e) { string ajID = Request.QueryString["id"]; this.ajstatus.Text = "2"; object[] obj1 = new object[] { yjtime, yjdanwei, jsren, ajstatus, remark1 }; string [] info = new string[] { "移交时间", "移交单位", "经手人" }; bool check = true; for (int i = 0; i < info.Length; i++) { if (Util.GetControlValue((Control)obj1[i]) == null || Util.GetControlValue((Control)obj1[i]) == "") { check = false; Util.alert(this.Page, "错误提示:【" + info[i] + "】栏目不能为空!"); break; } } if (check) { Hashtable ht = new Hashtable(); Util.getPageData(obj1, ht); ht["ajstatus"] = "2"; DA_AnJuanBU anjuan2 = new DA_AnJuanBU(); bool result = anjuan2.MoveAnJuan(ajID, ht); anjuan2.Close(); if (result) { string url = Application["root"] + "/DangAn/AnJuanWeiHu.aspx"; Comm.ShowInfo("提示:移交案卷成功!", url, true); } else { Util.alert(this.Page, "错误提示:修改数据错误!"); } } }
//绑定页面控件的值 private void SetControlData() { if (Request.QueryString["id"] != null) { string anjuanID = Request.QueryString["id"]; DA_AnJuanBU anjuan1 = new DA_AnJuanBU(); DataSet ds1 = anjuan1.GetDetailByID1(anjuanID); anjuan1.Close(); if (ds1.Tables[0].Rows.Count > 0) { DataRow dr = ds1.Tables[0].Rows[0]; this.ajname.Text = dr["ajname"].ToString(); this.ajnum.Text = dr["ajnum"].ToString(); this.ajstatus.Text = dr["ajstatus"].ToString(); } else { throw new Exception("错误信息:案卷" + Request.QueryString["id"] + "不存在!"); } } }
//新增案卷 protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { object[] obj1 = new object[] { ajnum, ajname, ajkind, time0, ljren }; string[] info = new string[] { "案卷编号", "案卷名称", "案卷类型", "立卷时间", "立卷人" }; bool check = true; for (int i = 0; i < info.Length; i++) { if (Util.GetControlValue((Control)obj1[i]) == null || Util.GetControlValue((Control)obj1[i]) == "") { check = false; Util.alert(this.Page, "错误提示:【" + info[i] + "】栏目不能为空!"); break; } } if (check) { try { Hashtable ht = new Hashtable(); Util.getPageData(obj1, ht); DA_AnJuanBU anjuan2 = new DA_AnJuanBU(); anjuan2.TabCommand.InsertData(ht); anjuan2.Close(); string url = Request.RawUrl; Comm.ShowInfo("增加新案卷成功!", url, true); } catch { Util.alert(this.Page, "错误提示:增加案卷数据失败,可能的原因是数据类型有错误,请检查后重新输入!"); } } } }
private void SetControlData() { if (Request["id"] != null) { string id = Request["id"]; DA_AnJuanBU aj2 = new DA_AnJuanBU(); DataSet ds = aj2.GetDetailByID1(id); aj2.Close(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < arr0.Length; i++) { Util.SetControlValue(this.ajnum.Parent.FindControl(arr0[i]), ds.Tables[0].Rows[0][arr0[i]]); } if (ds.Tables[0].Rows[0]["time0"] != DBNull.Value) { this.time0.Text = DateTime.Parse(ds.Tables[0].Rows[0]["time0"].ToString()).ToString("yyyy-MM-dd"); } if (ds.Tables[0].Rows[0]["yjtime"] != DBNull.Value) { this.yjtime.Text = DateTime.Parse(ds.Tables[0].Rows[0]["yjtime"].ToString()).ToString("yyyy-MM-dd"); } if (ds.Tables[0].Rows[0]["ajstatus"].ToString() == "2") { this.ajstatus.Text = "已移交"; } else { this.ajstatus.Text = ""; } } ds.Dispose(); } }
//更新文件资料 protected void Button1_Click(object sender, EventArgs e) { Hashtable ht = new Hashtable(); foreach (string item in arr1) { ht[item] = Util.GetControlValue(this.ajnum.Parent.FindControl(item)); } ht.Remove("ajnum"); DA_FilesBU file2 = new DA_FilesBU(); file2.UpdateFileData(Request["fileID"], ht); file2.Close(); DA_AnJuanBU anjuan1 = new DA_AnJuanBU(); string id = anjuan1.GetIdByAjnum(this.ajnum.Text); anjuan1.Close(); string url = Application["root"] + "/DangAn/AnJuanDetailEdit.aspx?id=" + id; Comm.ShowInfo("操作提示:更新文件成功!", url); }