コード例 #1
0
    //保存数据
    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, "错误提示:更新资产数据失败,可能的原因是数据类型有错误,请检查【转入时间】日期,【本金利息】等为数值型后重新输入!");
        }
    }