123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525 |
- using LYFZ.BLL;
- using LYFZ.ComponentLibrary;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Data.SqlClient;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Web.UI.WebControls;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.OAShopManagement
- {
- public class frmReleaseBulletinBoard : LYFZ.Software.UI.OAShopManagement.frmReleaseBulletinBoard
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpShopBulletin sbbll = new LYFZ.BLL.BLL_ErpShopBulletin();
- LYFZ.BLL.BLL_ErpShopDesignatedAnnounced sdbll = new LYFZ.BLL.BLL_ErpShopDesignatedAnnounced();
- public frmReleaseBulletinBoard()
- {
- this.Load += frmReleaseBulletinBoard_Load;
- this.Shown += frmReleaseBulletinBoard_Shown;
- this.cmbSeenPeople.SelectedIndexChanged += comboBoxVisiblePeople_SelectedIndexChanged;
- this.btnUploadFile.Click += btnUploadFile_Click;
- this.btnRemoveFile.Click += btnRemoveFile_Click;
- this.btnDownloadFile.Click += btnDownloadFile_Click;
- this.btnRelease.Click += btnRelease_Click;
- this.btnClose.Click += btnClose_Click;
- this.cmbBulletinType.SelectedIndex = 0;
- this.cmbSeenPeople.SelectedIndex = 0;
- this.btnSeenPerson.Click += btnSeenPerson_Click;
- this.btnNext.Click += btnNext_Click;
- }
- /// <summary>
- /// 当前用户ID
- /// </summary>
- string EmployeeID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 提示变量(true 是提示)
- /// </summary>
- public bool Prompt = false;
- /// <summary>
- /// 类型
- /// </summary>
- public string StrType = "";
- /// <summary>
- /// 公告编号
- /// </summary>
- public string StrGGNumber = "";
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- /// <summary>
- /// 用户集合
- /// </summary>
- DataTable dtUser = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable;
- /// <summary>
- /// 获取当前服务器路径
- /// </summary>
- LYFZ.Model.Model_Config mConfig = new LYFZ.BLL.BLL_Config().GetModel_SysConfig();
- /// <summary>
- /// 服务器路径
- /// </summary>
- string StrServerPath = @"\UploadFiles\Announcement\";
- /// <summary>
- /// 弹窗时用的数据缓存
- /// </summary>
- DataTable dtPrompt = new DataTable();
- LYFZ.Model.Model_ErpShopBulletin currentBulletinModel = null;
- /// <summary>
- /// 当前公告内容对象
- /// </summary>
- public LYFZ.Model.Model_ErpShopBulletin CurrentBulletinModel
- {
- get { return currentBulletinModel; }
- set { currentBulletinModel = value; }
- }
- LYFZ.Model.Model_ErpShopDesignatedAnnounced currentPersonModel = null;
- /// <summary>
- ///
- /// </summary>
- public LYFZ.Model.Model_ErpShopDesignatedAnnounced CurrentPersonModel
- {
- get { return currentPersonModel; }
- set { currentPersonModel = value; }
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void frmReleaseBulletinBoard_Load(object sender, EventArgs e)
- {
- if (Prompt)
- {
- //dtPrompt = sdbll.GetDatatable(this.EmployeeID);
- dtPrompt = orbll.GetView_Custom("tb_ErpShopBulletin Left Join tb_ErpShopDesignatedAnnounced on Announced_announcement = Bulletin_TheID", StrWhere: "(readID not like '%" + EmployeeID + "%' or readID is null) and (Announced_issuerID like '%" + EmployeeID + "%' or Announced_issuerID is null or Announced_issuerID = '1')", ShowColumnName: "Bulletin_TheID,Bulletin_issuerID,Bulletin_announcement,Bulletin_Title,Bulletin_content,Bulletin_ReleaseTime,Bulletin_Accessory,Announced_issuerID,readID").Tables[0];
- this.btnRelease.Visible = false;
- this.btnNext.Visible = true;
- if (dtPrompt.Rows.Count > 0)
- { this.ToViewNext(); }
- else
- { this.Close(); }
- }
- }
- LYFZ.BLL.BLL_ErpShopBulletin bulletinBll = new BLL_ErpShopBulletin();
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void frmReleaseBulletinBoard_Shown(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.StrGGNumber))
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpShopBulletin Left Join tb_ErpShopDesignatedAnnounced on Announced_announcement = Bulletin_TheID", StrWhere: "Bulletin_TheID = '" + this.StrGGNumber + "'", ShowColumnName: "Bulletin_TheID,Bulletin_issuerID,Bulletin_announcement,Bulletin_Title,Bulletin_content,Bulletin_ReleaseTime,Bulletin_Accessory,Announced_issuerID,readID").Tables[0];
-
- this.cmbBulletinType.Text = tbl.Rows[0]["Bulletin_announcement"].ToString().Trim();
- this.txtBulletinTitle.Text = tbl.Rows[0]["Bulletin_Title"].ToString().Trim();
- if (!string.IsNullOrEmpty(tbl.Rows[0]["Announced_issuerID"].ToString().Trim()) && tbl.Rows[0]["Announced_issuerID"].ToString().Trim() != "1")
- {
- this.cmbSeenPeople.Text = "指定人员";
- }
- else
- {
- this.cmbSeenPeople.Text = "全员可见";
- }
- this.txtBulletinInfo.Text = tbl.Rows[0]["Bulletin_content"].ToString().Trim();
- string[] strArray = tbl.Rows[0]["Announced_issuerID"].ToString().Trim().Split(',');
- string StrSeenPerson = "";
- string StrSeenPersonNumber = "";
- for (int i = 0; i < strArray.Length; i++)
- {
- if (strArray[i].Trim() != LYFZ.BLL.BLL_ErpUser.Admin_20141125111443713)
- {
- StrSeenPersonNumber += strArray[i].Trim() + ",";
- DataRow dtRow = dtUser.Rows.Find(strArray[i].Trim());
- if (dtRow != null)
- {
- StrSeenPerson += dtRow["User_Name"].ToString() + ",";
- }
- }
- }
- this.txtSeenPerson.Text = StrSeenPerson.TrimEnd(',');
- this.txtSeenPerson.Tag = StrSeenPersonNumber.TrimEnd(',');
- string[] StrArrayPath = tbl.Rows[0]["Bulletin_Accessory"].ToString().Trim().Split('|');
- System.Windows.Forms.TreeNode root = null;
- for (int i = 0; i < StrArrayPath.Length; i++)
- {
- if (!string.IsNullOrEmpty(StrArrayPath[i].Trim()))
- {
- root = new System.Windows.Forms.TreeNode();
- root.Text = @"\" + StrArrayPath[i].Trim();
- root.Tag = @"\" + StrArrayPath[i].Trim();
- root.ForeColor = Color.Blue;
- this.treevFile.Nodes.Add(root);
- }
- }
- this.btnRelease.Text = "修改";
- if (tbl.Rows[0]["Bulletin_issuerID"].ToString().Trim() != this.EmployeeID && !LYFZ.BLL.BLL_ErpUser.IsAdministrator())
- { this.btnRelease.Enabled = false; }
- //this.btnRelease.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.BulletinBoardCompetence, CustomAttributes.OperatingAuthority.Update);
- }
- else
- {
- if (!Prompt)
- { this.cmbBulletinType.Text = this.StrType; }
- this.btnRelease.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.BulletinBoardCompetence, CustomAttributes.OperatingAuthority.Announcement);
- }
- }
- Hashtable htDataFile = new Hashtable();
- /// <summary>
- /// 可见范围选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void comboBoxVisiblePeople_SelectedIndexChanged(object sender, EventArgs e)
- {
- //判断可见范围
- if (cmbSeenPeople.SelectedItem.ToString() == "指定人员")
- { this.panelOrderPerson.Visible = true; }
- else
- { this.panelOrderPerson.Visible = false; }
- }
- /// <summary>
- /// 选择接单人
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSeenPerson_Click(object sender, EventArgs e)
- {
- new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses().txtOrdersPerson(this.txtSeenPerson, false);
- }
- /// <summary>
- /// 选择文件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnUploadFile_Click(object sender, EventArgs e)
- {
- OpenFileDialog openFileDialog = new OpenFileDialog();
- openFileDialog.Multiselect = true;
- openFileDialog.Title = "选择附件";
- if (openFileDialog.ShowDialog() == DialogResult.OK)
- {
- string[] StrFileArray = openFileDialog.FileNames;
- System.Windows.Forms.TreeNode root = null;
- for (int i = 0; i < StrFileArray.Length; i++)
- {
- root = new System.Windows.Forms.TreeNode();
- root.Text = StrFileArray[i].Trim(); //new System.IO.FileInfo(StrFileArray[i].Trim()).Name;
- root.Tag = StrFileArray[i].Trim();
- root.ForeColor = Color.Red;
- this.treevFile.Nodes.Add(root);
- }
- }
- }
- /// <summary>
- /// 移除文件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnRemoveFile_Click(object sender, EventArgs e)
- {
- if (this.treevFile.Nodes.Count > 0)
- {
- if (this.treevFile.SelectedNode.ForeColor != Color.Red)
- {
- if (MessageBoxCustom.Show("您选择的附件已保存在服务上,你确定要移除'" + this.treevFile.SelectedNode.Text.Trim() + "'吗?", "温馨提示!", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- string StrTreevServerPathFile = StrServerPath + "\\" + this.StrGGNumber + "\\" + new System.IO.FileInfo(this.treevFile.SelectedNode.Tag.ToString().Trim()).Name;
- htDataFile[this.treevFile.SelectedNode.Tag.ToString().Trim()] = "移除";
- }
- this.treevFile.Nodes.Remove(this.treevFile.SelectedNode);
- }
- }
- /// <summary>
- /// 下载文件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDownloadFile_Click(object sender, EventArgs e)
- {
- if (this.treevFile.Nodes.Count > 0)
- {
- if (this.treevFile.SelectedNode != null)
- {
- if (this.treevFile.SelectedNode.ForeColor != Color.Red)
- {
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- string StrOldPath = this.treevFile.SelectedNode.Tag.ToString();
- string StrFileName = new System.IO.FileInfo(StrOldPath).Name;
- saveFileDialog.Filter = "压缩文件(*." + StrFileName.Split('.')[1].ToString() + ")|*." + StrFileName.Split('.')[1].ToString();
- saveFileDialog.FilterIndex = 1;
- if (saveFileDialog.ShowDialog() == DialogResult.OK)
- {
- string StrPath = saveFileDialog.FileName;
- LYFZ.Software.MainBusiness.TCPFileTransfer tcpFile = new MainBusiness.TCPFileTransfer();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- try
- {
- backgroundWorker.ReportProgress(0, "正在连接服务器...");
- string ret = tcpFile.DownloadFile(StrPath, StrOldPath, backgroundWorker);
- MessageBoxCustom.Show(ret, backgroundWorker: backgroundWorker);
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message, backgroundWorker: backgroundWorker); }
- });
- }
- }
- else
- { MessageBoxCustom.Show("你选择的附件尚未保存,请先保存后再下载!"); }
- }
- }
- }
- /// <summary>
- /// 发布
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnRelease_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.cmbBulletinType.Text.Trim()))
- { MessageBoxCustom.Show("公告类型不能为空!"); return; }
- if (string.IsNullOrEmpty(this.txtBulletinInfo.Text.Trim()))
- { MessageBoxCustom.Show("公告内容不能为空!"); return; }
- if (this.cmbSeenPeople.Text.Trim() == "指定人员")
- {
- if (this.txtSeenPerson.Tag == null)
- { MessageBoxCustom.Show("请选择公告可见人员!"); return; }
- }
- string StrNumber =String.Format("GG{0}", LYFZ.WinAPI.CustomPublicMethod.GenerateId());//SDateTime.Now.ToString("yyyyMMddHHmmss") + new Random().Next(100, 1000);
- string SqlPath = "";
- for (int i = 0; i < this.treevFile.Nodes.Count; i++)
- {
- string StrTreevServerPathFile = StrServerPath + StrNumber + @"\" + new System.IO.FileInfo(this.treevFile.Nodes[i].Tag.ToString().Trim()).Name;
- SqlPath += StrTreevServerPathFile + "|";
- if (this.treevFile.Nodes[i].ForeColor == Color.Red)
- {
- htDataFile[StrTreevServerPathFile + "|" + this.treevFile.Nodes[i].Tag.ToString().Trim()] = "新增";
- }
- }
-
- // LYFZ.Model.Model_ErpShopBulletin modelBulletin = null;
- // LYFZ.Model.Model_ErpShopDesignatedAnnounced modelPerson = null;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- if (!string.IsNullOrEmpty(this.StrGGNumber))
- {
- currentBulletinModel = sbbll.GetModel("Bulletin_TheID", this.StrGGNumber);
- currentBulletinModel.Bulletin_issuerID = this.EmployeeID;
- currentBulletinModel.Bulletin_announcement = this.cmbBulletinType.Text;
- currentBulletinModel.Bulletin_Title = this.txtBulletinTitle.Text;
- currentBulletinModel.Bulletin_content = this.txtBulletinInfo.Text;
- currentBulletinModel.Bulletin_ReleaseTime = SDateTime.Now;
- currentBulletinModel.Bulletin_Accessory = SqlPath;
- currentBulletinModel.Bulletin_ReleaseTime = SDateTime.Now;
- clist.Add(sbbll.GetUpdateCommandInfo(currentBulletinModel));
- CurrentPersonModel = sdbll.GetModel("Announced_announcement", this.StrGGNumber);
- if (this.txtSeenPerson.Tag != null)
- {
- if (!string.IsNullOrEmpty(this.txtSeenPerson.Tag.ToString().Trim()) && this.txtSeenPerson.Tag.ToString().Trim() != "1")
- {
- string[] Str = this.txtSeenPerson.Tag.ToString().Trim().Split('|')[0].Split(',');
- if (Str.Length > 0)
- {
- string StrOrderPerson = "";
- for (int i = 0; i < Str.Length; i++)
- { StrOrderPerson += Str[i] + ","; }
- StrOrderPerson += LYFZ.BLL.BLL_ErpUser.Admin_20141125111443713;
- CurrentPersonModel.Announced_issuerID = StrOrderPerson;
- }
- }
- }
- else
- { CurrentPersonModel.Announced_issuerID = "1"; }
- CurrentPersonModel.Announced_announcement = this.StrGGNumber;
- CurrentPersonModel.readID = "";
- clist.Add(sdbll.GetUpdateCommandInfo(CurrentPersonModel));
- }
- else
- {
- currentBulletinModel = new LYFZ.Model.Model_ErpShopBulletin();
- currentBulletinModel.Bulletin_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- currentBulletinModel.Bulletin_issuerID = this.EmployeeID;
- currentBulletinModel.Bulletin_announcement = this.cmbBulletinType.Text;
- currentBulletinModel.Bulletin_Title = this.txtBulletinTitle.Text;
- currentBulletinModel.Bulletin_content = this.txtBulletinInfo.Text;
- currentBulletinModel.Bulletin_ReleaseTime = SDateTime.Now;
- currentBulletinModel.Bulletin_Accessory = SqlPath;
- currentBulletinModel.Bulletin_TheID = StrNumber;
- clist.Add(sbbll.GetAddCommandInfo(currentBulletinModel));
- CurrentPersonModel = new Model.Model_ErpShopDesignatedAnnounced();
- if (this.txtSeenPerson.Tag != null)
- {
- if (!string.IsNullOrEmpty(this.txtSeenPerson.Tag.ToString().Trim()) && this.txtSeenPerson.Tag.ToString().Trim() != "1")
- {
- string[] Str = this.txtSeenPerson.Tag.ToString().Trim().Split('|')[0].Split(',');
- if (Str.Length > 0)
- {
- string StrOrderPerson = "";
- for (int i = 0; i < Str.Length; i++)
- { StrOrderPerson += Str[i] + ","; }
- StrOrderPerson += LYFZ.BLL.BLL_ErpUser.Admin_20141125111443713;
- CurrentPersonModel.Announced_issuerID = StrOrderPerson;
- }
- }
- }
- else
- { CurrentPersonModel.Announced_issuerID = "1"; }
- CurrentPersonModel.Announced_announcement = currentBulletinModel.Bulletin_TheID;
- CurrentPersonModel.readID = "";
- clist.Add(sdbll.GetAddCommandInfo(CurrentPersonModel));
- }
- LYFZ.Software.MainBusiness.TCPFileTransfer tcpFile = new MainBusiness.TCPFileTransfer();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- backgroundWorker.ReportProgress(0, "正在连接服务器...");
- foreach (DictionaryEntry de in htDataFile)
- {
- try
- {
- string ret = "";
- if (de.Value.ToString().Trim() == "移除")
- { ret = tcpFile.DeleteFile(de.Key.ToString().Trim(), backgroundWorker); }
- else
- {
- string[] StrArray = de.Key.ToString().Trim().Split('|');
- ret = tcpFile.UploadFileToServer(StrArray[1].Trim(), StrArray[0].Trim(), backgroundWorker);
- }
- if (ret.IndexOf("成功") == -1)
- { MessageBoxCustom.Show(ret, backgroundWorker: backgroundWorker); }
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message, backgroundWorker: backgroundWorker); }
- }
- });
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) >= 0)
- {
- this.IsSaveed = true;
- if (string.IsNullOrEmpty(this.StrGGNumber))
- { this.StrGGNumber = StrNumber; }
- this.htDataFile.Clear();
-
- for (int i = 0; i < this.treevFile.Nodes.Count; i++)
- {
- if (this.treevFile.Nodes[i].Text.Trim() != "" && this.treevFile.Nodes[i].ForeColor == Color.Red)
- {
- string StrNodeText = StrServerPath + @"\" + StrNumber + @"\" + new System.IO.FileInfo(this.treevFile.Nodes[i].Tag.ToString().Trim()).Name;
- this.treevFile.Nodes[i].Text = StrNodeText;
- this.treevFile.Nodes[i].Tag = StrNodeText;
- this.treevFile.Nodes[i].ForeColor = Color.Blue;
- }
- }
- MessageBoxCustom.Show("发布成功");
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- else
- { MessageBoxCustom.Show("发布失败"); }
-
- }
- /// <summary>
- /// 下一条
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnNext_Click(object sender, EventArgs e)
- {
- if (this.dtPrompt.Rows.Count > 0)
- {
- this.ToViewNext();
- }
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 查看下一条
- /// </summary>
- void ToViewNext(int IndexCount = 0)
- {
- this.cmbBulletinType.Text = dtPrompt.Rows[IndexCount]["Bulletin_announcement"].ToString().Trim();
- this.txtBulletinTitle.Text = dtPrompt.Rows[IndexCount]["Bulletin_Title"].ToString().Trim();
- if (!string.IsNullOrEmpty(dtPrompt.Rows[IndexCount]["Announced_issuerID"].ToString().Trim()) && dtPrompt.Rows[IndexCount]["Announced_issuerID"].ToString().Trim() != "1")
- { this.cmbSeenPeople.Text = "指定人员"; }
- else
- { this.cmbSeenPeople.Text = "全员可见"; }
- this.txtBulletinInfo.Text = dtPrompt.Rows[IndexCount]["Bulletin_content"].ToString().Trim();
- string[] strArray = dtPrompt.Rows[IndexCount]["Announced_issuerID"].ToString().Trim().Split(',');
- string StrSeenPerson = "";
- string StrSeenPersonNumber = "";
- for (int i = 0; i < strArray.Length; i++)
- {
- if (strArray[i].Trim() != LYFZ.BLL.BLL_ErpUser.Admin_20141125111443713)
- {
- StrSeenPersonNumber += strArray[i].Trim() + ",";
- DataRow dtRow = dtUser.Rows.Find(strArray[i].Trim());
- if (dtRow != null)
- { StrSeenPerson += dtRow["User_Name"].ToString() + ","; }
- }
- }
- this.txtSeenPerson.Text = StrSeenPerson.TrimEnd(',');
- this.txtSeenPerson.Tag = StrSeenPersonNumber.TrimEnd(',');
- string[] StrArrayPath = dtPrompt.Rows[IndexCount]["Bulletin_Accessory"].ToString().Trim().Split('|');
- System.Windows.Forms.TreeNode root = null;
- for (int i = 0; i < StrArrayPath.Length; i++)
- {
- if (!string.IsNullOrEmpty(StrArrayPath[i].Trim()))
- {
- root = new System.Windows.Forms.TreeNode();
- root.Text = "\\" + StrArrayPath[i].Trim();
- root.Tag = "\\" + StrArrayPath[i].Trim();
- root.ForeColor = Color.Blue;
- this.treevFile.Nodes.Add(root);
- }
- }
- if (sdbll.Exists("Announced_announcement", dtPrompt.Rows[IndexCount]["Bulletin_TheID"].ToString().Trim()))
- {
- ///存在
- Model.Model_ErpShopDesignatedAnnounced model = sdbll.GetModel("Announced_announcement", dtPrompt.Rows[IndexCount]["Bulletin_TheID"].ToString().Trim());
- model.readID = model.readID + EmployeeID + ",";
- if (!sdbll.Update(model))
- { MessageBoxCustom.Show("公告发生错误!"); }
- }
- this.dtPrompt.Rows.RemoveAt(IndexCount);
- if (dtPrompt.Rows.Count > 0)
- { this.Text = "发布公告:【你有:" + dtPrompt.Rows.Count + "条未读公告】"; }
- else
- {
- this.Text = "发布公告";
- this.btnNext.Enabled = false;
- }
- //this.cmbBulletinType.Text = dgv.Rows[indexlenght].Cells["公告类型"].Value.ToString();
- //this.txtBulletinTitle.Text = dgv.Rows[indexlenght].Cells["标题"].Value.ToString();
- //this.txtBulletinInfo.Text = dgv.Rows[indexlenght].Cells["内容"].Value.ToString();
- //if (dgv.Rows[indexlenght].Cells["文件路径"].Value.ToString() != "")
- //{
- // Shangchuan = true;
- //}
- //else { btnUploadFile.Visible = false; }
- //IsNullAdd(dgv.Rows[indexlenght].Cells["公告ID"].Value.ToString());
- }
- }
- }
|