public int NewLog(String ProjectGuidID,
                          String Stitle, String Content, String Kind,
                          System.Web.UI.WebControls.FileUpload f1,
                          ref String RelateFile, ref String RelaTrueName)
        {
            int    succ      = 0;
            String FileDir   = "/Attachment/UseAttachment/";
            String truename1 = String.Empty;
            bool   saveFile  = false;

            try
            {
                Dictionary <String, object> dic1 = new Dictionary <string, object>();

                dic1["guidID"]     = WebFrame.Util.JString.GetUnique32ID();
                dic1["parentGuid"] = ProjectGuidID;
                dic1["Stitle"]     = Stitle;
                if (String.IsNullOrEmpty(Content) == false)
                {
                    dic1["Content"] = (new StringBuilder()).Append(Content);
                }
                dic1["AddTime"]    = DateTime.Now;
                dic1["AddUserID"]  = WebFrame.FrameLib.UserID;
                dic1["AddUserNet"] = WebFrame.FrameLib.UserName;
                dic1["kind"]       = Kind;

                if (f1 != null && f1.HasFile)
                {
                    String ext1 = Path.GetExtension(f1.FileName);
                    truename1 = WebFrame.Util.JString.GetUnique32ID() + ext1;
                    f1.SaveAs(System.Web.HttpContext.Current.Server.MapPath(FileDir + truename1));
                    dic1["RelateFile"]   = FileDir + truename1;
                    dic1["RelaTrueName"] = Path.GetFileName(f1.FileName);

                    //文件名和文件路径
                    RelateFile   = dic1["RelateFile"].ToString();
                    RelaTrueName = dic1["RelaTrueName"].ToString();

                    saveFile = true;
                }
                Tb_Task_LogDA da1 = new Tb_Task_LogDA();
                da1.NewData(dic1);
                succ = 1;
            }
            catch (Exception err)
            {
                //删除已上传的文件
                if (saveFile && File.Exists(System.Web.HttpContext.Current.Server.MapPath(FileDir + truename1)))
                {
                    File.Delete(System.Web.HttpContext.Current.Server.MapPath(FileDir + truename1));
                }
                throw err;
            }

            return(succ);
        }
 /// <summary>
 /// 新增一条数据
 /// </summary>
 /// <param name="data1">Dictionary数据</param>
 public void NewData(Dictionary <String, object> data1)
 {
     try
     {
         Tb_Task_LogDA da1 = new Tb_Task_LogDA();
         da1.NewData(data1);
         this.executeResultCount = da1.ExecuteResultCount;
     }
     catch (Exception err)
     {
         this.ErrorInfo = err.Message.Replace("\r", "").Replace("\t", "").Replace("\n", "");
     }
 }