private void SetControlData() { if (Request["id"] != null) { string id = Request["id"]; DA_JieYuanBU jyue1 = new DA_JieYuanBU(); DataSet ds = jyue1.GetDetailByID(id); jyue1.Close(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < arr0.Length; i++) { Util.SetControlValue(this.bill.Parent.FindControl(arr0[i]), ds.Tables[0].Rows[0][arr0[i]]); } if (ds.Tables[0].Rows[0]["paytime1"].ToString() == "") { //this.paytime.Text = ""; this.paytime1.Text = ""; } else { this.paytime1.Text = DateTime.Parse(ds.Tables[0].Rows[0]["paytime1"].ToString()).ToString("yyyy-MM-dd"); } this.paytime.Text = DateTime.Parse(ds.Tables[0].Rows[0]["paytime"].ToString()).ToString("yyyy-MM-dd"); this.billtime.Text = DateTime.Parse(ds.Tables[0].Rows[0]["billtime"].ToString()).ToString("yyyy-MM-dd"); } ds.Dispose(); } }
// protected void Button4_Click(object sender, EventArgs e) { Hashtable ht = new Hashtable(); ht.Add("status", "1"); DA_JieYuanBU jyue4 = new DA_JieYuanBU(); //修改借阅单的状态 bool result = jyue4.ShengChengJieYuanBill(Request.QueryString["id"], ht); if (result) { Util.alert(this.Page, "借阅单已产生!"); //修改案卷中文件的借阅人、借阅时间,登记人、登记时间 DA_JieYuanBU jyue1 = new DA_JieYuanBU(); string[] allId = jyue1.GetAllIdBybill(this.bill.Text); Hashtable ht1 = new Hashtable(); ht1.Add("djtime", this.billtime.Text.Trim()); ht1.Add("dtmen", this.billmen.Text.ToString()); ht1.Add("jyue", this.zeren.Text.ToString()); ht1.Add("jyuetime", this.billtime.Text.Trim()); for (int i = 0; i < allId.Length; i++) { DA_FilesBU file1 = new DA_FilesBU(); file1.UpdateJieyueInfo(allId[i].ToString(), ht1); } Response.Redirect("FileJieyue.aspx"); } }
//添加复印文件 protected void Button1_Click(object sender, EventArgs e) { object[] obj0 = new object[] { title, copycount }; string[] info = new string[] { "文件名称", "复印份数" }; bool check = true; for (int i = 0; i < info.Length; i++) { if (Util.GetControlValue((Control)obj0[i]) == null || Util.GetControlValue((Control)obj0[i]) == "") { check = false; Util.alert(this.Page, "错误提示:【" + info[i] + "】栏目不能为空!"); break; } } if (check) { Hashtable ht = new Hashtable(); ht.Add("bill", this.bill.Text);//加入复印单编号 DA_CopyBU copy1 = new DA_CopyBU(); DA_JieYuanBU jyue1 = new DA_JieYuanBU(); //通过文号获取文件ID string fileId = copy1.GetFileIdByTitle(this.title.Text.ToString().Trim()); if (fileId == null) { Util.alert(this.Page, "文件【" + this.title.Text.ToString() + "】不存在!"); } else { //判断文件是否已经被借阅 DA_FilesBU file1 = new DA_FilesBU(); bool jyuestatus = file1.IsOrNotJieYue(fileId); if (jyuestatus)// { ht.Add("fileid", fileId); ht.Add("copycount", this.copycount.Text.ToString()); bool result = copy1.AddCopyFileData(ht); string id = copy1.GetIdBybill(this.bill.Text.ToString()); copy1.Close(); if (result) { Util.alert(this.Page, "新增文件成功!"); Response.Redirect("AddCopyFile.aspx?bill=" + this.bill.Text.Trim()); } else { Util.alert(this.Page, "错误提示:本复印单已存在此文件!"); } } else { Util.alert(this.Page, "错误提示:此文件被借阅,不能复印!"); } } } }
//返回到借阅单 protected void Button2_Click(object sender, EventArgs e) { DA_JieYuanBU jyue1 = new DA_JieYuanBU(); string id = jyue1.GetIdBybill(Request.QueryString["bill"]); jyue1.Close(); Response.Redirect("EditJieyueInfo.aspx?id=" + id, true); }
//删除一条数据 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { string id = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); DA_JieYuanBU jyue3 = new DA_JieYuanBU(); string bill = jyue3.GetbillById(id); jyue3.DeleteData(bill, id); this.BindData2(jyue3); jyue3.Close(); }
private void BindData1(string zeren) { DA_JieYuanBU jyue1 = new DA_JieYuanBU(); DataSet ds = jyue1.GetJieyueList1(zeren); //DataSet ds = jyue1.GetJieyueList(); this.GridView1.DataSource = ds; this.GridView1.DataBind(); jyue1.Close(); }
//确定文件的借阅 protected void Button1_Click(object sender, EventArgs e) { string Files = ""; Hashtable ht = new Hashtable(); for (int i = 1; i < 6; i++) { string temp = Util.GetControlValue(this.title1.Parent.FindControl("title" + i)); string temp1 = Util.GetControlValue(this.title1.Parent.FindControl("ajnum" + i)); if (temp.Trim() != "") { ht[temp.Trim()] = temp.Trim() + "_" + temp1.Trim(); } if (temp != "" && temp1 == "") { if (Files == "") { Files = i.ToString(); } else { Files = Files + "," + i; } } } if (ht.Count == 0) { Util.alert(this.Page, "错误提示:你至少需要输入一个文件名称"); } else { if (Files != "") { Util.alert(this.Page, "错误提示:请检查文件" + Files + "是否输入档案编号!"); } else { DA_JieYuanBU jyue1 = new DA_JieYuanBU(); string result = jyue1.AddJyueFileData(Request.QueryString["bill"], ht); string id = jyue1.GetIdBybill(Request.QueryString["bill"]); jyue1.Close(); if (result == null) { PubComm.ShowInfo("提示:增加文件成功!", Application["root"] + "/DangAn/EditJieyueInfo.aspx?id=" + id); } else { Util.alert(this.Page, result); } } } }
protected void BindData() { if (Request.QueryString["id"] != null) { DA_JieYuanBU jyue1 = new DA_JieYuanBU(); DataSet ds = jyue1.GetDetailByID(Request.QueryString["id"]); jyue1.Close(); this.bill.Text = ds.Tables[0].Rows[0]["bill"].ToString(); this.paytime.Text = DateTime.Parse(ds.Tables[0].Rows[0]["paytime"].ToString()).ToString("yyyy-MM-dd"); this.paytim1.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DA_JieYuanBU jyue1 = new DA_JieYuanBU(); string bill = jyue1.GetBillNum(); this.zeren.Attributes["readonly"] = ""; this.bill.Text = bill; this.billtime.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); this.billtime.Attributes["onfocus"] = "setday(this)"; this.paytime.Attributes["onfocus"] = "setday(this)"; this.billmen.Text = User.Identity.Name; } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { //DA_JieYuanBU jyue2 = new DA_JieYuanBU(); //if (e.Row.DataItem != null) //{ // DataRow dr = ((DataRowView)e.Row.DataItem).Row; // bool result= jyue2.PuDuanStatus(dr["id"].ToString()); // //HyperLink link1 = (HyperLink)e.Row.FindControl("HyperLink1"); // if(result) // { // ((Label)e.Row.FindControl("status")).Text = "已确定"; // //link1.Visible = false; // } //} DA_JieYuanBU jyue2 = new DA_JieYuanBU(); if (e.Row.DataItem != null) { DataRow dr = ((DataRowView)e.Row.DataItem).Row; string status = jyue2.PuDuanStatus1(dr["id"].ToString()); LinkButton link1 = (LinkButton)e.Row.FindControl("LinkbutEdit"); LinkButton link2 = (LinkButton)e.Row.FindControl("Delbut"); LinkButton link3 = (LinkButton)e.Row.FindControl("paybut"); if (status == "1") { ((Label)e.Row.FindControl("status")).Text = "已确定"; link1.Visible = false; link2.Visible = false; } else if (status == "") { ((Label)e.Row.FindControl("status")).Text = "新单据"; link2.Visible = true; link1.Visible = true; link3.Visible = false; } if (status == "2") { ((Label)e.Row.FindControl("status")).Text = "已归还"; link1.Visible = false; link2.Visible = true; link3.Visible = false; } } }
private void BindFiles(DA_JieYuanBU jyue) { bool flag = false; if (jyue == null) { jyue = new DA_JieYuanBU(); flag = true; } DA_JieYuanBU jyue2 = new DA_JieYuanBU(); DataSet ds1 = jyue2.GetFileList(this.bill.Text.ToString()); Repeater1.DataSource = ds1; Repeater1.DataBind(); if (flag) { jyue2.Close(); } }
//删除Repeater里面的一条数据 protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.Item.FindControl("seldoc") != null) { string id = ((Label)e.Item.FindControl("seldoc")).Text; if (e.CommandName == "delete") { try { DA_JieYuanBU jyue3 = new DA_JieYuanBU(); jyue3.DeleteFile(id); this.BindFiles(jyue3); jyue3.Close(); } catch (Exception err1) { Util.alert(this.Page, err1.Message); } } } }
protected void Button1_Click(object sender, EventArgs e) { object[] obj0=new object[]{bill, billtime, billmen, zeren,paytime,remark }; object[] obj1 = new object[] { bill, billtime, billmen, zeren, paytime}; 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(obj0,ht); //ht.Add("status", "0"); DA_JieYuanBU jyue1=new DA_JieYuanBU(); jyue1.TabCommand.InsertData(ht); jyue1.Close(); Util.alert(this.Page,"增加借阅单成功!"); DA_JieYuanBU jyue2 = new DA_JieYuanBU(); string id= jyue2.GetIdBybill(this.bill.Text.ToString()); Response.Redirect("EditJieYueInfo.aspx?id="+id); } catch { Util.alert(this.Page, "错误提示:增加资产数据失败,可能的原因是数据类型有错误,请检查后重新输入!"); } } }
//归还借阅文件 protected void Button1_Click(object sender, EventArgs e) { Hashtable ht = new Hashtable(); ht.Add("paytime1", this.paytim1.Text.ToString()); ht.Add("status", "2"); DA_JieYuanBU jyue1 = new DA_JieYuanBU(); jyue1.UpdatePaytime(Request.QueryString["id"], ht); Hashtable ht1 = new Hashtable(); ht1.Add("jyue", DBNull.Value); ht1.Add("jyuetime", DBNull.Value); ht1.Add("djtime", DBNull.Value); ht1.Add("dtmen", DBNull.Value); string[] allId = jyue1.GetAllIdBybill(this.bill.Text); for (int i = 0; i < allId.Length; i++) { DA_FilesBU file1 = new DA_FilesBU(); file1.RemoveJieyueInfo(allId[i].ToString(), ht1); } Response.Redirect("FileJieyue.aspx"); }
private void BindData2(DA_JieYuanBU jyue1) { this.GridView1.DataSource = jyue1.GetAllBill(); this.GridView1.DataBind(); }