2021-04-30 10:28:37 +08:00
|
|
|
|
using BLL;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.TestRun.Meeting
|
|
|
|
|
{
|
|
|
|
|
public partial class ScheduleMeetingEdit : PageBase
|
|
|
|
|
{
|
|
|
|
|
#region 加载
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 页面加载
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
2024-03-08 23:33:10 +08:00
|
|
|
|
BLL.UserService.InitUserDropDownList(this.drpCompileMan, this.CurrUser.LoginProjectId, true);
|
2021-04-30 10:28:37 +08:00
|
|
|
|
string id = Request.Params["id"];
|
|
|
|
|
if (!string.IsNullOrEmpty(id))
|
|
|
|
|
{
|
|
|
|
|
Model.Driver_Meeting data = BLL.MeetingService.GetMeetingById(id);
|
|
|
|
|
if (data != null)
|
|
|
|
|
{
|
|
|
|
|
this.hdId.Text = id;
|
2024-03-31 01:12:53 +08:00
|
|
|
|
//this.txtMeetingCode.Text = data.MeetingCode;
|
|
|
|
|
//this.txtMeetingDate.Text = data.MeetingDate.HasValue ? string.Format("{0:yyyy-MM-dd}", data.MeetingDate) : "";
|
2021-04-30 10:28:37 +08:00
|
|
|
|
this.txtMeetingAddress.Text = data.MeetingAddress;
|
2024-03-31 01:12:53 +08:00
|
|
|
|
//this.txtMeetingUrl.Text = data.AttachUrl;
|
|
|
|
|
//if (!string.IsNullOrEmpty(data.CompileMan))
|
|
|
|
|
//{
|
|
|
|
|
// this.drpCompileMan.SelectedValue = data.CompileMan;
|
|
|
|
|
//}
|
|
|
|
|
//this.txtCompileDate.Text = data.CompileDate.HasValue ? string.Format("{0:yyyy-MM-dd}", data.CompileDate) : "";
|
2021-04-30 10:28:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2024-03-08 23:33:10 +08:00
|
|
|
|
{
|
2021-04-30 10:28:37 +08:00
|
|
|
|
this.txtMeetingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
2024-03-08 23:33:10 +08:00
|
|
|
|
this.drpCompileMan.SelectedValue = this.CurrUser.LoginProjectId;
|
|
|
|
|
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
|
|
|
|
string perfix = BLL.ProjectService.GetProjectCodeByProjectId(this.CurrUser.LoginProjectId) + "-MM-PSM-";
|
|
|
|
|
this.txtMeetingCode.Text = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.Driver_Meeting", "MeetingCode", this.CurrUser.LoginProjectId, perfix);
|
2021-04-30 10:28:37 +08:00
|
|
|
|
}
|
2024-03-08 23:33:10 +08:00
|
|
|
|
///初始化审核菜单
|
|
|
|
|
this.ctlAuditFlow.MenuId = BLL.Const.ScheduleMeetingMenuId;
|
|
|
|
|
this.ctlAuditFlow.DataId = id;
|
|
|
|
|
this.ctlAuditFlow.ProjectId = this.CurrUser.LoginProjectId;
|
|
|
|
|
this.ctlAuditFlow.UnitId = this.CurrUser.UnitId;
|
|
|
|
|
|
|
|
|
|
InitMenuTree();
|
2021-04-30 10:28:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 附件上传
|
|
|
|
|
/// <summary>
|
2024-03-08 23:33:10 +08:00
|
|
|
|
/// 会议纪要
|
2021-04-30 10:28:37 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnAttach_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
|
|
|
|
|
{
|
|
|
|
|
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.Driver_Meeting));
|
|
|
|
|
}
|
2024-03-08 23:33:10 +08:00
|
|
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/Meeting/ScheduleMeeting&menuId={1}&strParam=1", this.hdId.Text, BLL.Const.ScheduleMeetingMenuId)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 签到表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnSign_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
|
|
|
|
|
{
|
|
|
|
|
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.Driver_Meeting));
|
|
|
|
|
}
|
|
|
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/Meeting/ScheduleMeeting&menuId={1}&strParam=2", this.hdId.Text, BLL.Const.ScheduleMeetingMenuId)));
|
2021-04-30 10:28:37 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 保存
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存按钮
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-03-08 23:33:10 +08:00
|
|
|
|
SaveData(BLL.Const.BtnSave);
|
|
|
|
|
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提交按钮
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnSubmit_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.ctlAuditFlow.NextStep == BLL.Const.State_1 && this.ctlAuditFlow.NextPerson == BLL.Const._Null)
|
2021-04-30 10:28:37 +08:00
|
|
|
|
{
|
2024-03-08 23:33:10 +08:00
|
|
|
|
ShowNotify("请选择下一步办理人!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
2021-04-30 10:28:37 +08:00
|
|
|
|
}
|
2024-03-08 23:33:10 +08:00
|
|
|
|
SaveData(BLL.Const.BtnSubmit);
|
|
|
|
|
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="type"></param>
|
|
|
|
|
private void SaveData(string type)
|
|
|
|
|
{
|
|
|
|
|
string id = Request.Params["id"];
|
|
|
|
|
Model.Driver_Meeting newData = new Model.Driver_Meeting();
|
2024-03-31 01:12:53 +08:00
|
|
|
|
//newData.MeetingCode = this.txtMeetingCode.Text.Trim();
|
|
|
|
|
//newData.MeetingDate = Funs.GetNewDateTime(this.txtMeetingDate.Text.Trim());
|
2021-04-30 10:28:37 +08:00
|
|
|
|
newData.MeetingAddress = this.txtMeetingAddress.Text.Trim();
|
2024-03-31 01:12:53 +08:00
|
|
|
|
//newData.AttachUrl = this.txtMeetingUrl.Text.Trim();
|
|
|
|
|
//if (this.drpCompileMan.SelectedValue != BLL.Const._Null)
|
|
|
|
|
//{
|
|
|
|
|
// newData.CompileMan = this.drpCompileMan.SelectedValue;
|
|
|
|
|
//}
|
|
|
|
|
//newData.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim());
|
2021-04-30 10:28:37 +08:00
|
|
|
|
newData.ProjectId = this.CurrUser.LoginProjectId;
|
2024-03-08 23:33:10 +08:00
|
|
|
|
////单据状态
|
2024-03-31 01:12:53 +08:00
|
|
|
|
//newData.States = BLL.Const.State_0;
|
|
|
|
|
//if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
//{
|
|
|
|
|
// newData.States = this.ctlAuditFlow.NextStep;
|
|
|
|
|
//}
|
2021-04-30 10:28:37 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(id))
|
|
|
|
|
{
|
|
|
|
|
newData.MeetingId = id;
|
|
|
|
|
BLL.MeetingService.UpdateMeeting(newData);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
newData.MeetingType = "1";
|
|
|
|
|
if (!string.IsNullOrEmpty(this.hdId.Text))
|
|
|
|
|
{
|
|
|
|
|
newData.MeetingId = this.hdId.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
newData.MeetingId = SQLHelper.GetNewID(typeof(Model.Driver_Meeting));
|
|
|
|
|
this.hdId.Text = newData.MeetingId;
|
|
|
|
|
}
|
|
|
|
|
BLL.MeetingService.AddMeeting(newData);
|
|
|
|
|
}
|
2024-03-08 23:33:10 +08:00
|
|
|
|
|
|
|
|
|
#region 保存参会人员
|
|
|
|
|
BLL.MeetingItemService.DeleteMeetingItemByMeetingId(this.hdId.Text);
|
|
|
|
|
TreeNode[] nodes = this.tvAttendMeetingsPerson.GetCheckedNodes();
|
|
|
|
|
if (nodes.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (TreeNode tn in nodes)
|
|
|
|
|
{
|
|
|
|
|
if (tn.NodeID != "0")
|
|
|
|
|
{
|
|
|
|
|
Model.Driver_MeetingItem newItem = new Model.Driver_MeetingItem
|
|
|
|
|
{
|
|
|
|
|
MeetingItemId = SQLHelper.GetNewID(typeof(Model.Driver_MeetingItem)),
|
|
|
|
|
MeetingId = this.hdId.Text,
|
|
|
|
|
UserId = tn.NodeID,
|
|
|
|
|
};
|
|
|
|
|
BLL.MeetingItemService.AddMeetingItem(newItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
////保存流程审核数据
|
2024-03-31 01:12:53 +08:00
|
|
|
|
//this.ctlAuditFlow.btnSaveData(this.CurrUser.LoginProjectId, BLL.Const.ScheduleMeetingMenuId, this.hdId.Text, (type == BLL.Const.BtnSubmit ? true : false), newData.MeetingCode, null);
|
2024-03-08 23:33:10 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 初始化树
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化树
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="menuList">单位集合</param>
|
|
|
|
|
private void InitMenuTree()
|
|
|
|
|
{
|
|
|
|
|
this.tvAttendMeetingsPerson.Nodes.Clear();
|
|
|
|
|
var units = BLL.UnitService.GetUnitByProjectIdList(this.CurrUser.LoginProjectId);
|
|
|
|
|
foreach (var item in units)
|
|
|
|
|
{
|
|
|
|
|
TreeNode rootNode = new TreeNode
|
|
|
|
|
{
|
|
|
|
|
Text = item.UnitName,
|
|
|
|
|
NodeID = item.UnitId,
|
|
|
|
|
EnableCheckBox = true,
|
|
|
|
|
EnableCheckEvent = true,
|
|
|
|
|
Expanded = true
|
|
|
|
|
};
|
|
|
|
|
this.tvAttendMeetingsPerson.Nodes.Add(rootNode);
|
|
|
|
|
this.BoundTree(rootNode.Nodes, rootNode.NodeID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 遍历增加子节点
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="nodes"></param>
|
|
|
|
|
/// <param name="menuId"></param>
|
|
|
|
|
private void BoundTree(TreeNodeCollection nodes, string superMenuId)
|
|
|
|
|
{
|
|
|
|
|
var menus = BLL.UserService.GetUserByUnitId(this.CurrUser.LoginProjectId, superMenuId);
|
|
|
|
|
foreach (var item in menus)
|
|
|
|
|
{
|
|
|
|
|
TreeNode chidNode = new TreeNode
|
|
|
|
|
{
|
|
|
|
|
Text = item.Text,
|
|
|
|
|
NodeID = item.Value,
|
|
|
|
|
EnableCheckBox = true,
|
|
|
|
|
EnableCheckEvent = true
|
|
|
|
|
};
|
|
|
|
|
var items = BLL.MeetingItemService.GetMeetingItemByMeetingId(this.hdId.Text.Trim());
|
|
|
|
|
if (items.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var i in items)
|
|
|
|
|
{
|
|
|
|
|
if (i.UserId == item.Value)
|
|
|
|
|
{
|
|
|
|
|
chidNode.Checked = true;
|
|
|
|
|
chidNode.Expanded = true;
|
|
|
|
|
chidNode.Selectable = true;
|
2024-03-31 01:12:53 +08:00
|
|
|
|
//var meeting = BLL.MeetingService.GetMeetingById(this.hdId.Text.Trim());
|
|
|
|
|
//if (meeting != null)
|
|
|
|
|
//{
|
|
|
|
|
// if (meeting.States == "2")
|
|
|
|
|
// {
|
|
|
|
|
// if (i.IsMeeting == true)
|
|
|
|
|
// {
|
|
|
|
|
// chidNode.Text = item.Text + "(可按时参加)";
|
|
|
|
|
// }
|
|
|
|
|
// else if (i.IsMeeting == false)
|
|
|
|
|
// {
|
|
|
|
|
// chidNode.Text = item.Text + "(因故不参加:" + i.Feedback + ")";
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// chidNode.Text = item.Text + "(暂未反馈)";
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
2024-03-08 23:33:10 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
nodes.Add(chidNode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 全选、全不选
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 全选、全不选
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void tvAttendMeetingsPerson_NodeCheck(object sender, FineUIPro.TreeCheckEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.Checked)
|
|
|
|
|
{
|
|
|
|
|
this.tvAttendMeetingsPerson.CheckAllNodes(e.Node.Nodes);
|
|
|
|
|
SetCheckParentNode(e.Node);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.tvAttendMeetingsPerson.UncheckAllNodes(e.Node.Nodes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 选中父节点
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="node"></param>
|
|
|
|
|
private void SetCheckParentNode(TreeNode node)
|
|
|
|
|
{
|
|
|
|
|
if (node.ParentNode != null && node.ParentNode.NodeID != "0")
|
|
|
|
|
{
|
|
|
|
|
node.ParentNode.Checked = true;
|
|
|
|
|
if (node.ParentNode.ParentNode.NodeID != "0")
|
|
|
|
|
{
|
|
|
|
|
SetCheckParentNode(node.ParentNode);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-30 10:28:37 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|