Exemplo n.º 1
0
        /// <summary>
        /// 写入数据
        /// </summary>
        /// <param name="FormID">表单ID</param>
        /// <param name="content">富文本框内容</param>
        /// <param name="userinfo">用户实体</param>
        /// <returns>bool</returns>
        public bool AddContent(string FormID, byte[] content, string CompanyID, string SystemCode, string ModelName, UserInfo userinfo)
        {
           
            using (SysRtfBLL bll = new SysRtfBLL())
            {
                try
                {
                    string fileId = Guid.NewGuid().ToString();
                    
                    T_SYS_RTF t_SYS_RTF = new T_SYS_RTF();
                    string fileDirectory = AppDomain.CurrentDomain.BaseDirectory + userinfo.COMPANYID
                           + @"\" + userinfo.DEPARTMENTID
                           + @"\" + userinfo.POSTID;
                    DirectoryInfo target = new DirectoryInfo(fileDirectory);
                    if (!target.Exists)
                    {
                        target.Create();
                    }
                    string filePath = fileDirectory + @"\" + fileId;
                    if (!File.Exists(filePath))
                    {
                        FileStream fs = File.Create(filePath); //path是文件的路径                                  
                        fs.Write(content, 0, content.Length);
                        fs.Close();
                    }                    
                    t_SYS_RTF.CONTENT = filePath;
                    t_SYS_RTF.RTFID = fileId;
                    t_SYS_RTF.SYSTEMCODE = SystemCode;
                    t_SYS_RTF.COMPANYID = CompanyID;
                    t_SYS_RTF.MODELNAME = ModelName;
                    t_SYS_RTF.FORMID = FormID;
                    t_SYS_RTF.OWNERID = userinfo.USERID;
                    t_SYS_RTF.OWNERNAME = userinfo.USERNAME;
                    t_SYS_RTF.OWNERCOMPANYID = userinfo.COMPANYID;
                    t_SYS_RTF.OWNERDEPARTMENTID = userinfo.DEPARTMENTID;
                    t_SYS_RTF.OWNERPOSTID = userinfo.POSTID;
                    t_SYS_RTF.CREATEUSERID = userinfo.USERID;
                    t_SYS_RTF.CREATEUSERNAME = userinfo.USERNAME;
                    t_SYS_RTF.CREATECOMPANYID = userinfo.COMPANYID;
                    t_SYS_RTF.CREATEDEPARTMENTID = userinfo.DEPARTMENTID;
                    t_SYS_RTF.CREATEPOSTID = userinfo.POSTID;
                    t_SYS_RTF.CREATEDATE = DateTime.Now;

                    string pathR = t_SYS_RTF.CONTENT;
                    bool flag = bll.AddContent(t_SYS_RTF);
                    return flag;
                }catch(Exception ex)
                {
                    Tracer.Debug(ex.ToString());
                    return false;
                }
            }
        }
Exemplo n.º 2
0
 public void AddContent(string p, string p_2, string p_3, string p_4, string p_5, UserInfo userInfo)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 /// <summary>
 /// 修改数据
 /// </summary>
 /// <param name="FormID">表单ID</param>
 /// <param name="content">内容</param>
 /// <param name="UPDATEUSERID">用户ID</param>
 /// <param name="UPDATEUSERNAME">用户名</param>
 /// <returns>bool</returns>
 public bool UpdateContent(string FormID, byte[] content, UserInfo userinfo)
 {
     using (SysRtfBLL bll = new SysRtfBLL())
     {
         return bll.UpdateContent(FormID, content, userinfo);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 写入数据
 /// </summary>
 /// <param name="FormID">表单ID</param>
 /// <param name="content">富文本框内容</param>
 /// <param name="userinfo">用户实体</param>
 /// <returns>bool</returns>
 public bool AddContent(string FormID, byte[] content, string CompanyID, string SystemCode, string ModelName, UserInfo userinfo)
 {
     using (SysRtfBLL bll = new SysRtfBLL())
     {
         T_SYS_RTF t_SYS_RTF = new T_SYS_RTF();
         t_SYS_RTF.RTFID = Guid.NewGuid().ToString();
         t_SYS_RTF.SYSTEMCODE = SystemCode;
         t_SYS_RTF.COMPANYID = CompanyID;
         t_SYS_RTF.MODELNAME = ModelName;
         t_SYS_RTF.FORMID = FormID;
         t_SYS_RTF.OWNERID = userinfo.USERID;
         t_SYS_RTF.OWNERNAME = userinfo.USERNAME;
         t_SYS_RTF.OWNERCOMPANYID = userinfo.COMPANYID;
         t_SYS_RTF.OWNERDEPARTMENTID = userinfo.DEPARTMENTID;
         t_SYS_RTF.OWNERPOSTID = userinfo.POSTID;
         t_SYS_RTF.CREATEUSERID = userinfo.USERID;
         t_SYS_RTF.CREATEUSERNAME = userinfo.USERNAME;
         t_SYS_RTF.CREATECOMPANYID = userinfo.COMPANYID;
         t_SYS_RTF.CREATEDEPARTMENTID = userinfo.DEPARTMENTID;
         t_SYS_RTF.CREATEPOSTID = userinfo.POSTID;
         t_SYS_RTF.CREATEDATE = DateTime.Now;
         t_SYS_RTF.CONTENT = content;
         return bll.AddContent(t_SYS_RTF);
     }
 }