//保存数据 private void SaveData1() { if (Request["id"] != null) { U_ZCBU zc3 = new U_ZCBU(); DataSet ds2 = zc3.GetDetailByID(Request["id"].ToString()); Hashtable ht1 = new Hashtable(); //foreach (string item in arr1) //{ // ht1[item] = ds2.Tables[0].Rows[0][item].ToString(); //} //foreach (string item in arr2) //{ // ht1[item] = ds2.Tables[0].Rows[0][item].ToString(); //} ht1["zcid"] = Request["id"].ToString(); ht1["xgr"] = User.Identity.Name; ht1["xgsj"] = DateTime.Now.ToString(); zc3.InsertOldZC(ht1); } Hashtable ht = new Hashtable(); //foreach (string item in arr1) //{ // ht[item] = Util.GetControlValue(this.zcbao.Parent.FindControl(item)); //} //foreach (string item in arr2) //{ // ht[item] = Util.GetControlValue(this.zcbao.Parent.FindControl(item)); //} ht.Remove("status"); ht.Remove("zhuang"); //提交数据保存 try { U_ZCBU zc1 = new U_ZCBU(); zc1.UpdateInfo(Request["id"], ht); zc1.Close(); this.BindOldZCInfo(); this.SetPageData(); Util.alert(this.Page, "操作提示:更新资料成功!"); } catch (Exception err1) { Util.alert(this.Page, "错误提示:更新资产数据失败,可能的原因是数据类型有错误,请检查【转入时间】日期,【本金利息】等为数值型后重新输入!"); } }
//更新资产数据 protected void SaveDataClick(object sender, EventArgs e) { //设置更新字段 //String[] arr1 = new string[] { "danwei","zhwd","num1","num2","huobei","huilv","bj", // "sshy","quyu","guangxia","zcbao","bank","htnum", // "zzjg","jysfzc","clsj","zczb","dqjj","qygm","dwdz","dwfzr", // "qyjjxz","yxzzzk","xdri","dkffrq1","jklsh","dkye","dkffrq2","htdqr", // "zjycszje","zydbfs","dbrwmc","yyldxt","xcyqrq","jrblsj","fenlei","remark"}; String[] arr1 = new string[] { "danwei", "zhwd", "num1", "num2", "huobei", "huilv", "bj", "lx1", "lx2", "lx3", "sshy", "quyu", "guangxia", "zcbao", "bank", "htnum", "time0", "zzjg", "jysfzc", "clsj", "zczb", "dqjj", "qygm", "dwdz", "dwfzr", "qyjjxz", "yxzzzk", "xdri", "dkffrq1", "jklsh", "dkye", "dkffrq2", "htdqr", "zjycszje", "zydbfs", "dbrwmc", "yyldxt", "xcyqrq", "jrblsj", "fenlei", "remark" }; Hashtable ht = new Hashtable(); for (int i = 0; i < arr1.Length; i++) { if (this.zcbao.Parent.FindControl(arr1[i]) != null) { ht.Add(arr1[i], Util.GetControlValue(this.zcbao.Parent.FindControl(arr1[i]))); } } try { U_ZCBU zc1 = new U_ZCBU(); zc1.UpdateInfo(Request["id"], ht); zc1.Close(); //向直接领导发送邮件操作 string title = String.Format("用户{0}已修改了档案号为{1}的资产档案", User.Identity.Name, this.num2.Text); string remark = title + "<br><br><b><font color='#ff0000'>此邮件要求提交审阅意见</font></b>"; //PubComm.SendMailToLeader(title, remark,Request.RawUrl); PubComm.ShowInfo("操作提示:更新资料成功!", Request.RawUrl); } catch (Exception err) { Util.alert(this.Page, "错误提示:更新资产数据失败,可能的原因是数据类型有错误,请检查【转入时间】日期,【本金利息】等为数值型后重新输入!"); //Response.Write(err.ToString()); } }
//上传长江资产公司不良贷款逐户调查表.doc protected void Button1_Click(object sender, EventArgs e) { if (this.FileUpload1.FileName != null && this.FileUpload1.PostedFile.ContentLength > 0) { string filename = null; if (this.OldFileName.Value == "") { filename = Request["zcid"].ToString() + "_" + Util.GetRandomString(9) + "_" + this.FileUpload1.FileName; this.OldFileName.Value = filename; } else { filename = this.OldFileName.Value; } string filename1 = Server.MapPath("~/Common/AttachFiles/") + filename; this.FileUpload1.SaveAs(filename1); //保存文件到系统 //更新数据库中的数据 if (this.OldFileName.Value != "") { Hashtable ht = new Hashtable(); ht["tcdoc"] = this.OldFileName.Value; U_ZCBU zc1 = new U_ZCBU(); zc1.UpdateInfo(Request["zcid"].ToString(), ht); zc1.Close(); } //////////////////////////////////////// Util.alert(this.Page, "文件上传成功,请关闭当前窗口!"); } else { Util.alert(this.Page, "错误提示:请选择一个【不良资产逐户调查表】文件上传!"); } }