private void FillTaskInfoByNode() { XVTaskInfo childTaskInfo = this.m_ChildTaskTreeNode.Tag as XVTaskInfo; if (childTaskInfo != null) { this.txtChildTaskName.Text = childTaskInfo.TaskName; this.txtChildTaskName.Tag = childTaskInfo.RID; this.txtChildTaskNo.Text = childTaskInfo.TaskNo; this.dtChildTaskStartDate.Value = XHelper.GetDateTime(childTaskInfo.StartDate); this.dtChildTaskPreEnd.Value = XHelper.GetDateTime(childTaskInfo.PreEndDate); } TreeNode parentTaskNode = this.m_ChildTaskTreeNode.Parent; if (parentTaskNode != null) { XVTaskInfo parentTaskInfo = parentTaskNode.Tag as XVTaskInfo; this.txtMainId.Text = parentTaskInfo.TaskName; this.txtTaskNo.Text = parentTaskInfo.TaskNo; this.dtStartDate.Value = XHelper.GetDateTime(parentTaskInfo.StartDate); this.dtPreEndDate.Value = XHelper.GetDateTime(parentTaskInfo.PreEndDate); } }
protected override void FillRowViewInfos(XModelBase model, System.Data.DataRow modelRow) { XVTaskInfo taskInfo = model as XVTaskInfo; taskInfo.TaskType = XHelper.GetString(modelRow["TaskType"]); taskInfo.ParentTaskName = XHelper.GetString(modelRow["ParentTaskName"]); taskInfo.ParentTaskNo = XHelper.GetString(modelRow["ParentTaskNo"]); taskInfo.ParentStartDate = XHelper.GetString(modelRow["ParentStartDate"]); taskInfo.ParentPreEndDate = XHelper.GetString(modelRow["ParentPreEndDate"]); taskInfo.AssignPeopleName = XHelper.GetString(modelRow["AssignPeopleName"]); }
private TreeNode GetTreeNodeByModel(XModelBase model) { TreeNode treeNode = new TreeNode(); XVTaskInfo taskInfo = model as XVTaskInfo; string text = taskInfo.TaskName; treeNode.Text = text; treeNode.ToolTipText = text; treeNode.Tag = model; return(treeNode); }
/// <summary> /// 设置修改时的默认值 /// </summary> protected override void SetDefaultValue() { XVTaskInfo info = this.m_CurrentModel as XVTaskInfo; if (info == null) { return; } if (info.TaskTypeId != string.Empty) { this.txtTaskTypeId.Text = info.TaskType; this.txtTaskTypeId.ValueMember = info.TaskTypeId; this.txtTaskTypeId.DisplayMember = info.TaskName; } this.txtTaskName.Text = info.TaskName; this.txtTaskNo.Text = info.TaskNo; this.txtStartPeople.Text = info.StartPeople; this.dtDispatchDate.Value = XHelper.GetDateTime(info.DispatchDate); if (info.AssignPeople != string.Empty) { this.txtAssignPeople.Text = info.AssignPeopleName; this.txtAssignPeople.ValueMember = info.AssignPeople; this.txtAssignPeople.DisplayMember = info.AssignPeopleName; } this.dtStartDate.Value = XHelper.GetDateTime(info.StartDate); this.dtPreEndDate.Value = XHelper.GetDateTime(info.PreEndDate); this.txtShortDesc.Text = info.ShortDesc; this.txtRequire.Text = info.Require; this.txtContent.Text = info.Content; this.txtRemark.Text = info.Remark; this.txtTaskStatus.Text = info.TaskStatus; if (this.m_TreeNode.Parent != null) { XTaskInfo parentTaskInfo = this.m_TreeNode.Parent.Tag as XTaskInfo; this.txtParentTask.Text = parentTaskInfo.TaskName; this.txtParentTask.Tag = parentTaskInfo; } }
/// <summary> /// 填充实体信息 /// </summary> protected override void FillModelInfo() { XVTaskInfo info = this.m_CurrentModel as XVTaskInfo; if (this.m_EditStatus == XEditStatus.AddNew || this.m_EditStatus == XEditStatus.AddContinue) { info.RID = this.GetNewId(); info.ID = info.RID; if (this.m_TreeNode != null) { XTaskInfo parentTaskInfo = this.m_TreeNode.Tag as XTaskInfo; info.ParentId = parentTaskInfo.RID; } } info.TaskTypeId = this.txtTaskTypeId.ValueMember; info.TaskType = this.txtTaskTypeId.DisplayMember; info.TaskName = this.txtTaskName.Text; info.TaskNo = this.txtTaskNo.Text; info.StartPeople = this.txtStartPeople.Text; info.DispatchDate = XHelper.GetFormatedDate(this.dtDispatchDate.Value); info.AssignPeople = this.txtAssignPeople.ValueMember; info.AssignPeopleName = this.txtAssignPeople.DisplayMember; info.StartDate = XHelper.GetFormatedDate(this.dtStartDate.Value); info.PreEndDate = XHelper.GetFormatedDate(this.dtPreEndDate.Value); info.ShortDesc = this.txtShortDesc.Text; info.Require = this.txtRequire.Text; info.Content = this.txtContent.Text; info.Remark = this.txtRemark.Text; info.TaskStatus = this.txtTaskStatus.Text.Trim(); this.FillSaveDetailList(); if (this.m_EditStatus == XEditStatus.Edit) { this.FillDeleteList();//填充删除的明细字典 } base.FillModelInfo(); }
private void tvTask_AfterSelect(object sender, TreeViewEventArgs e) { TreeNode selectedNode = e.Node; XVTaskInfo info = selectedNode.Tag as XVTaskInfo; if (m_LastSelctedNode != null) { m_LastSelctedNode.BackColor = Color.White; } selectedNode.BackColor = Color.LightBlue; m_LastSelctedNode = selectedNode; if (info != null) { //如果选中的是任务节点 this.tabTask.SelectedIndex = 0; this.txtTaskTypeId.Text = info.TaskType; this.txtTaskName.Text = info.TaskName; this.txtTaskNo.Text = info.TaskNo; this.txtStartPeople.Text = info.StartPeople; this.dtDispatchDate.Value = XHelper.GetDateTime(info.DispatchDate); this.txtAssignPeople.Text = info.AssignPeopleName; this.dtStartDate.Value = XHelper.GetDateTime(info.StartDate); this.dtPreEndDate.Value = XHelper.GetDateTime(info.PreEndDate); this.txtShortDesc.Text = info.ShortDesc; this.txtRequire.Text = info.Require; this.txtContent.Text = info.Content; this.txtRemark.Text = info.Remark; if (selectedNode.Parent != null) { XTaskInfo parentTaskInfo = selectedNode.Parent.Tag as XTaskInfo; this.txtParentTask.Text = parentTaskInfo.TaskName; this.txtParentTaskNo.Text = parentTaskInfo.TaskNo; this.dtParentStartDate.Value = XHelper.GetDateTime(parentTaskInfo.StartDate); this.dtParentPreEndDate.Value = XHelper.GetDateTime(parentTaskInfo.PreEndDate); } else { this.txtParentTask.Text = string.Empty; this.txtParentTaskNo.Text = string.Empty; //this.dtParentStartDate.Value = //this.dtParentPreEndDate.Value = XHelper.GetDateTime(parentTaskInfo.PreEndDate); } if (this.IsChildTaskNode(selectedNode)) { //如果选择的是子任务 this.FillFilesGrid(info.RID); } else { //如果是根级节点 this.grdFiles.DataSource = this.m_TaskFilesBusiness.GetViewListByRootTaskId(info.RID); this.grdFiles.AutoSizeColumns(); } this.FillTaskAttachGrid(info.RID); } else { this.tabTask.SelectedIndex = 1; //文件节点 XVTaskFilesInfo taskFileInfo = selectedNode.Tag as XVTaskFilesInfo; this.txtFileName.Text = taskFileInfo.FileName; this.txtFileDesc.Text = taskFileInfo.FileDesc; this.txtFileRemark.Text = taskFileInfo.Remark; } }