private bool CreateNotice(string strdownfiles, string strid) { #region 加载系统通知 ArrayList alDownNoti = new ArrayList(); alDownNoti = m1.DownNotice(strid); if (alDownNoti == null) { clog.WriteLine("加载系统通知错误"); return(false); } #endregion StreamWriter swFile = new StreamWriter(strdownfiles + ".tmp", true); StructToString sts = new StructToString(); #region 写系统通知 CMSMStruct.NoticeStruct notitmp = null; swFile.WriteLine("NOTITOL=" + alDownNoti.Count.ToString()); for (int i = 0; i < alDownNoti.Count; i++) { notitmp = alDownNoti[i] as CMSMStruct.NoticeStruct; swFile.WriteLine(sts.ToNoticeString(notitmp)); } swFile.WriteLine("END"); #endregion swFile.Close(); #region 加密 DESEncryptor dese = new DESEncryptor(); dese.InputFilePath = strdownfiles + ".tmp"; dese.OutFilePath = strdownfiles; dese.EncryptKey = "cmsmyykx"; dese.FileDesEncrypt(); if (dese.NoteMessage != null) { clog.WriteLine(dese.NoteMessage); return(false); } dese = null; #endregion if (System.IO.File.Exists(strdownfiles + ".tmp")) { System.IO.File.Delete(strdownfiles + ".tmp"); } return(true); }
public ArrayList DownNotice(string strid) { DataTable dtnoti = new DataTable(); ArrayList alnoti = new ArrayList(); string sql1 = "select * from tbNotice where id='" + strid + "'"; dtnoti = SqlHelper.ExecuteDataTable(con, CommandType.Text, sql1); for (int i = 0; i < dtnoti.Rows.Count; i++) { CMSMStruct.NoticeStruct notitmp = new CMSMStruct.NoticeStruct(); notitmp.strid = dtnoti.Rows[i]["id"].ToString(); notitmp.strComments = dtnoti.Rows[i]["vcComments"].ToString(); notitmp.strCreateDate = dtnoti.Rows[i]["dtCreateDate"].ToString(); notitmp.strActiveFlag = dtnoti.Rows[i]["vcActiveFlag"].ToString(); notitmp.strDeptFlag = dtnoti.Rows[i]["vcDeptFlag"].ToString(); alnoti.Add(notitmp); } return(alnoti); }