//提交数据处理 void Button1_Click(object sender, EventArgs e) { String sname1 = this.sname.SelectedValue; String kind1 = this.kind.SelectedValue; string id1 = Request.QueryString["id"]; CommTable comm1 = new CommTable("U_LawZC"); Hashtable ht1 = new Hashtable(); ht1["sname"] = sname1; ht1["kind"] = kind1; ht1["dotime"] = DateTime.Now.ToString(); ht1["checkmen"] = Page.User.Identity.Name; if (String.IsNullOrEmpty(id1) == false) { List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("id", id1, SearchFieldType.数值型)); comm1.EditQuickData(condition, ht1); } else { comm1.InsertData(ht1); } comm1.Close(); Response.Redirect("FixLawGwList.aspx", true); }
void Button1_Click(object sender, EventArgs e) { try { CommTable com1 = new CommTable("CW_ShouKuanPlan"); Hashtable ht1 = new Hashtable(); if (String.IsNullOrEmpty(Request.QueryString["zcid"]) == false) { ht1["zcid"] = Request.QueryString["zcid"]; } ht1["kind"] = Request.QueryString["kind"]; ht1["pbj"] = double.Parse(this.pbj.Text); ht1["plx"] = "0"; ht1["time0"] = DateTime.Parse(this.time0.Text).ToString("yyyy-MM-dd"); ht1["remark"] = this.remark.Text; com1.InsertData(ht1); com1.Close(); if (Request.QueryString["kind"] == "0") { Response.Redirect("ZcDetail5.aspx?id=" + Request.QueryString["zcid"], true); } else { Response.Redirect("ZcBaoDetail5.aspx?id=" + Request.QueryString["zcid"], true); } } catch (Exception err) { JSJ.SysFrame.Util.alert(this.Page, "错误:数据类型输入有错,请检查!"); } }
//写入档案日志 public static void WriteDAFileLog(String FileName, String remark) { CommTable tab1 = new CommTable("DA_AJDZFile"); List <SearchField> condition = new List <SearchField>(); SearchField search1 = new SearchField("ajTrueFile", FileName); condition.Add(search1); DataSet ds1 = tab1.SearchData("*", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { DataRow dr1 = ds1.Tables[0].Rows[0]; tab1.TabName = "DA_AJDZFileSeeLog"; Hashtable ht1 = new Hashtable(); ht1["ajnum"] = dr1["ajnum"].ToString(); ht1["time0"] = DateTime.Now.ToString(); ht1["domen"] = Comm.CurUser.ToLower(); ht1["ajFile"] = dr1["ajFile"].ToString(); if (String.IsNullOrEmpty(remark) == false) { ht1["remark"] = remark; } tab1.InsertData(ht1); } tab1.Dispose(); tab1.Close(); }
protected void Button1_Click(object sender, EventArgs e) { if (this.FileUpload1.FileBytes.Length > 0) { String fileName = this.FileUpload1.FileName; String savefileName = fileName + "_" + Page.User.Identity.Name + "_" + DateTime.Now.ToString(); savefileName = PubComm.GetMd5(savefileName) + ".data"; ///////////////////////////////////////// this.FileUpload1.SaveAs(Server.MapPath("~/Common/AttachFiles/" + savefileName)); ///////////////////////////////////////// CommTable comm1 = new CommTable(); comm1.TabName = "U_CZFile"; Hashtable ht = new Hashtable(); ht["czid"] = Request["id"]; ht["FileName"] = savefileName; ht["trueName"] = fileName; comm1.InsertData(ht); comm1.Close(); Response.Redirect(Request.PathInfo, true); } else { JSJ.SysFrame.Util.alert(this.Page, "请点浏览选择一个要上传的文件!"); } }
/// <summary> /// 写入时效提醒日志 /// </summary> /// <param name="timeid"></param> public static void WriteLog(String timeid, String UserName) { CommTable comm1 = new CommTable("U_TimeLog"); Hashtable ht1 = new Hashtable(); ht1["timeid"] = timeid; ht1["logtime"] = DateTime.Now.ToString(); ht1["loguser"] = UserName; comm1.InsertData(ht1); comm1.Close(); }
//发送消息 protected void Button1_Click(object sender, EventArgs e) { CommTable com1 = null; Hashtable ht = new Hashtable(); com1 = new CommTable(); com1.TabName = "ZX_QuickTalk"; ht["fmen"] = User.Identity.Name; ht["tmen"] = this.to1.Text; ht["remark"] = this.remark.Text; ht["time0"] = DateTime.Now.ToString(); ht["isread"] = "0"; com1.InsertData(ht); Response.Write("<b><center>发送信息成功,请关闭窗口!</center></b>"); Response.End(); }
//执行数据处理 protected void Button2_Click(object sender, EventArgs e) { CommTable comm1 = new CommTable(); comm1.TableConnect.BeginTrans(); try { comm1.TabName = "U_ZCTC"; Hashtable data = new Hashtable(); data["zcid"] = Request["zcid"]; data["czid"] = Request["czid"]; data["time0"] = DateTime.Now.ToString(); data["remark"] = this.remark.Text; data["didian"] = this.didian.Text; data["jieguo"] = this.jieguo.Text; data["kind"] = Request["kind"]; data["zeren"] = User.Identity.Name; comm1.InsertData(data); //更新U_ZC和U_ZC2中的相关状态数据 if (Request["kind"] != null) { SearchField search0 = new SearchField("id", Request["zcid"]); comm1.TabName = "U_ZC"; Hashtable ht = new Hashtable(); ht["status"] = Request["kind"].Trim(); comm1.EditQuickData(search0, ht); comm1.TabName = "U_ZC2"; search0 = new SearchField("id", Request["czid"]); comm1.EditQuickData(search0, ht); } comm1.TableConnect.CommitTrans(); this.Button1_Click(sender, e); } catch (Exception err) { comm1.TableConnect.RollBackTrans(); JSJ.SysFrame.Util.alert(this.Page, "错误:数据库事务错误,请重试!"); } comm1.Close(); }
//将数据保存 protected void btn1_Click(object sender, EventArgs e) { CommTable comm1 = new CommTable(); comm1.TabName = "ZX_RCAP"; //保存老的数据 if (this.id.Value == "") { Hashtable ht = new Hashtable(); ht["time0"] = DateTime.Now.ToString(); ht["sname"] = User.Identity.Name; U_UserNameBU user1 = new U_UserNameBU(); ht["depart"] = user1.GetDepart1(User.Identity.Name); user1.Close(); ht["plantime"] = this.plantime.Text; ht["subject"] = Util.GetMaxLenth(this.subject.Text, 90); ht["remark"] = this.remark.Text; comm1.InsertData(ht); } else { string infoid = this.id.Value; List <SearchField> list1 = new List <SearchField>(); list1.Add(new SearchField("id", infoid, SearchFieldType.数值型)); list1.Add(new SearchField("sname", User.Identity.Name)); Hashtable ht = new Hashtable(); ht["plantime"] = this.plantime.Text; ht["subject"] = Util.GetMaxLenth(this.subject.Text, 90); ht["remark"] = this.remark.Text; comm1.EditQuickData(list1, ht); } comm1.Close(); Response.Redirect("MyRcaiPai.aspx", true); }
/// <summary> /// 增加新的资产审批表数据 /// </summary> /// <param name="data"></param> public int InsertData(Hashtable data) { int zcid = 0; CommTable com1 = new CommTable("U_ZC2"); com1.TableConnect.BeginTrans(); try { com1.InsertData(data); String sql = "select @@identity as zcid"; DataSet ds = com1.TableComm.SearchData(sql); if (ds.Tables[0].Rows.Count > 0) { zcid = int.Parse(ds.Tables[0].Rows[0]["zcid"].ToString()); } com1.TableConnect.CommitTrans(); } catch (Exception err) { com1.TableConnect.RollBackTrans(); } com1.Close(); return(zcid); }
protected void Button1_Click(object sender, EventArgs e) { Hashtable ht = new Hashtable(); ht.Add("status1", this.status1.SelectedValue); ht.Add("status2", this.status2.SelectedValue); ht.Add("zcid", Request.QueryString["zcid"]); ht.Add("time0", DateTime.Now.ToString()); ht.Add("zeren", User.Identity.Name); if (this.remark.Text.Trim() != String.Empty) { ht.Add("remark", this.remark.Text); } else { ht.Add("remark", "无"); } ht.Add("czid", Request.QueryString["czid"]); ht.Add("kind", "2"); if (this.dotime.Text.Trim() != String.Empty) { ht.Add("dotime", this.dotime.Text); } CommTable comm1 = null; bool success = false; try { comm1 = new CommTable(); comm1.TableConnect.BeginTrans(); //新增U_ZCTC表中的数据 comm1.TabName = "U_ZCTC"; comm1.InsertData(ht); //更改U_ZC2中表的数据 String zcid = null; String zcbid = null; comm1.TabName = "U_ZC2"; List <SearchField> condition = new List <SearchField>(); condition.Add(new SearchField("id", Request.QueryString["czid"])); DataSet ds1 = comm1.SearchData("id,zcid,zcbid,spresult,status1,status2,spdotime", condition); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { DataRow dr1 = ds1.Tables[0].Rows[0]; zcid = dr1["zcid"].ToString().Trim(); zcbid = dr1["zcbid"].ToString().Trim(); dr1["spresult"] = this.spresult.SelectedValue; dr1["status1"] = this.status1.SelectedValue; dr1["status2"] = this.status2.SelectedValue; if (String.IsNullOrEmpty(this.dotime.Text.Trim()) == false) { dr1["spdotime"] = this.dotime.Text.Trim(); } comm1.Update(ds1); } //更新资产或资产包中的相关数据 if (String.IsNullOrEmpty(zcid) == false || String.IsNullOrEmpty(zcbid) == false) { condition.Clear(); //优先考虑资产包 if (String.IsNullOrEmpty(zcbid) == false) { comm1.TabName = "U_ZCBAO"; condition.Add(new SearchField("id", zcbid, SearchFieldType.数值型)); } else { comm1.TabName = "U_ZC"; condition.Add(new SearchField("id", zcid, SearchFieldType.数值型)); } DataSet ds2 = comm1.SearchData("id,spresult,status1,status2,spdotime", condition); if (ds2 != null && ds2.Tables[0].Rows.Count > 0) { DataRow dr2 = ds2.Tables[0].Rows[0]; dr2["spresult"] = this.spresult.SelectedValue; dr2["status1"] = this.status1.SelectedValue; dr2["status2"] = this.status2.SelectedValue; if (String.IsNullOrEmpty(this.dotime.Text.Trim()) == false) { dr2["spdotime"] = this.dotime.Text.Trim(); } comm1.Update(ds2); } } comm1.TableConnect.CommitTrans(); success = true; } catch (Exception err) { comm1.TableConnect.RollBackTrans(); } finally { comm1.Close(); } //更改数据后返回 if (success) { Response.Redirect("EditSbb.aspx?id=" + Request.QueryString["czid"] + "&menuIndex=6", true); } else { JSJ.SysFrame.Util.alert(this.Page, "提示:数据库事务处理失败,请重试!"); } }