/// <summary> /// 保存 /// </summary> /// <param name="stakehoders"></param> /// <returns></returns> public JsonResult SaveStakehoders(Stakeholders stakehoders, out string _id) { _id = ""; JsonResult jsonreslut = new JsonResult(); try { jsonreslut.result = false; if (string.IsNullOrEmpty(stakehoders.ID)) { new Repository <Stakeholders>().Insert(stakehoders, true, out _id); } else { new Repository <Stakeholders>().Update(stakehoders, true, out _id); } jsonreslut.result = true; } catch (Exception ex) { LogHelper.WriteException(ex, LogType.BussinessDLL); jsonreslut.result = false; jsonreslut.msg = ex.Message; } return(jsonreslut); }
public void AddStakeholder(int userId, StakeholderType type) { Stakeholders.Add(Stakeholder.Create(userId, type)); // raise domain event AddDomainEvent(new StakeholderAddedDomainEvent(Uid, userId, type)); }
/// <summary> /// 点击干系人列表加载干系人信息和干系人沟通方式列表 /// </summary> /// <param name="PID"></param> /// <param name="stakeholders">干系人实体</param> /// <param name="communication">沟通方式集合</param> public void GetCommunicationMatix(List <QueryField> qf, out Stakeholders stakeholders, out List <CommunicationFXFA> FXFAlist) { stakeholders = new Stakeholders(); FXFAlist = new List <CommunicationFXFA>(); #region 干系人 StringBuilder sql = new StringBuilder(); sql.Append(" select * from stakeholders s where s.PID=@PID and substr(s.Id,1,37)||'1'=@Id and s.Status=@Status"); sql.Append(" order by s.UPDATED desc , s.CREATED desc"); DataTable dt = NHHelper.ExecuteDataTable(sql.ToString(), qf); stakeholders = dt == null ? new Stakeholders() : JsonHelper.TableToEntity <Stakeholders>(dt); #endregion #region 沟通方式列表 StringBuilder sql2 = new StringBuilder(); sql2.Append(" select fxfa.*,c.Name as CNAME from communicationFXFA fxfa left join communication c on c.Id = fxfa.CID"); sql2.Append(" where fxfa.SID=@ID and c.PID=@PID and c.Status=@Status and fxfa.Status=@Status"); sql2.Append(" order by fxfa.CREATED"); DataSet ds2 = NHHelper.ExecuteDataset(sql2.ToString(), qf); var dt2 = new DataTable(); if (ds2 != null && ds2.Tables.Count > 0) { dt2 = ds2.Tables[0]; } FXFAlist = JsonHelper.TableToList <CommunicationFXFA>(dt2).ToList(); #endregion }
private void LoadStakeholders() { Stakeholders.Clear(); foreach (var stakeholder in Decisions.SelectMany(decision => decision.Stakeholders).Distinct()) { Stakeholders.Add(stakeholder.Stakeholder); } }
/// <summary> /// 选择干系人事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listBoxAdv1_ItemClick(object sender, EventArgs e) { Stakeholders stakeholders = new Stakeholders(); List <CommunicationFXFA> list = new List <CommunicationFXFA>(); bll.GetCommunicationMatix(ProjectId, listBoxAdv1.SelectedValue.ToString(), out stakeholders, out list); if (stakeholders != null) { txtCompanyName.Text = stakeholders.CompanyName; txtDuty.Text = stakeholders.Duty; txtEmail.Text = stakeholders.Email; txtName.Text = stakeholders.Name; txtPosition.Text = stakeholders.Position; txtQQ.Text = stakeholders.QQ; txtTel.Text = stakeholders.Tel; txtWechat.Text = stakeholders.Wechat; cbIspublic.CheckValue = stakeholders.IsPublic; dtiCREATED.Value = stakeholders.CREATED; type = stakeholders.Type; sendtype = stakeholders.SendType; ID = stakeholders.ID; CREATED = stakeholders.CREATED; } if (list != null && list.Count > 0) { txtAddress1.Text = list[0].Addr; txtContent1.Text = list[0].Content; txtCommunicateDate1.Text = list[0].CommunicateDate; txtFrenquence1.Text = list[0].Frequency; DataHelper.SetComboBoxSelectItemByValue(cmbCommunication1, list[0].CID); FXFAID1 = list[0].ID; if (list.Count > 1) { txtAddress2.Text = list[1].Addr; txtContent2.Text = list[1].Content; txtConmunicateDate2.Text = list[0].CommunicateDate; txtFrenquence2.Text = list[0].Frequency; DataHelper.SetComboBoxSelectItemByValue(cmbCommunication2, list[1].CID); FXFAID2 = list[1].ID; } if (list.Count > 2) { txtAddress3.Text = list[2].Addr; txtContent3.Text = list[2].Content; txtConmunicateDate3.Text = list[0].CommunicateDate; txtFrenquence3.Text = list[0].Frequency; DataHelper.SetComboBoxSelectItemByValue(cmbCommunication3, list[2].CID); FXFAID3 = list[2].ID; } } }
/// <summary> /// 获取干系人详情及交流方式 /// </summary> /// <param name="PID"></param> /// <param name="stakeholdersId"></param> /// <param name="stakeholders"></param> /// <param name="communicationList"></param> public void GetCommunicationMatix(string PID, string stakeholdersId, out Stakeholders stakeholders, out List <CommunicationFXFA> communicationList) { List <QueryField> qf = new List <QueryField>(); qf.Add(new QueryField() { Name = "PID", Type = QueryFieldType.String, Value = PID }); qf.Add(new QueryField() { Name = "Status", Type = QueryFieldType.Numeric, Value = 1 }); qf.Add(new QueryField() { Name = "Id", Type = QueryFieldType.String, Value = stakeholdersId }); new CommunicationMatrixDao().GetCommunicationMatix(qf, out stakeholders, out communicationList); }
/// <summary> /// 项目合同基本信息 新增或修改 /// Created:20170324(ChengMengjia) /// </summary> /// <param name="jbxx"></param> /// <returns></returns> public JsonResult SaveJBXX(ContractJBXX entity) { JsonResult jsonreslut = new JsonResult(); try { string _id; if (string.IsNullOrEmpty(entity.ID)) { new Repository <ContractJBXX>().Insert(entity, true, out _id); List <Stakeholders> list = new StakeholdersBLL().GetList(entity.PID, null);//所有干系人 //干系人中项目经理为空 if (!string.IsNullOrEmpty(entity.B_PManager) && list.Where(t => t.IsPublic == 1 && t.Status == 1).Count() <= 0) { Stakeholders person = new Stakeholders(); person.PID = entity.PID; person.Name = entity.B_PManager; person.Tel = entity.B_PManagerTel; person.Type = 2;//项目组 person.IsPublic = 1; new Repository <Stakeholders>().Insert(person, true); } //干系人中客户判断有无此人 if (!string.IsNullOrEmpty(entity.A_Manager) && list.Where(t => t.Type == 1 && t.Status == 1 && t.Name == entity.A_Manager).Count() <= 0) { Stakeholders person = new Stakeholders(); person.PID = entity.PID; person.Name = entity.A_Manager; person.Tel = entity.A_ManagerTel; person.Type = 1;//客户 person.IsPublic = 0; new Repository <Stakeholders>().Insert(person, true); } //干系人中项目组判断有无此人 if (!string.IsNullOrEmpty(entity.B_Manager) && list.Where(t => t.Type == 2 && t.Status == 1 && t.Name == entity.B_Manager).Count() <= 0) { Stakeholders person = new Stakeholders(); person.PID = entity.PID; person.Name = entity.B_Manager; person.Tel = entity.B_Tel; person.Type = 2;//项目组 person.IsPublic = 0; new Repository <Stakeholders>().Insert(person, true); } } else { new Repository <ContractJBXX>().Update(entity, true, out _id); } jsonreslut.data = _id; jsonreslut.result = true; jsonreslut.msg = "保存成功!"; } catch (Exception ex) { LogHelper.WriteException(ex, LogType.BussinessDLL); jsonreslut.result = false; jsonreslut.msg = ex.Message; } return(jsonreslut); }
/// <summary> /// 保存干系人 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSaveStakeholders_Click(object sender, EventArgs e) { #region 检查 int flag = 0; //没有选项目经理 string flagid = string.Empty; //项目经理id if (superGridControl1.PrimaryGrid.Rows.Count != 0) { foreach (var item in superGridControl1.PrimaryGrid.Rows) { string s = item.ToString(); s = s.Replace("{", ","); s = s.Replace("}", ","); string[] listS = s.Split(','); if (int.Parse(listS[4].Trim()) != 0) { flag = 1; flagid = listS[3].Trim(); } } } if (flag != 0 && cbIspublic.Checked && flagid != ID) { MessageBox.Show("不能存在多个项目经理"); return; } var rows = superGridControl1.PrimaryGrid.GetSelectedRows(); if (rows.Count != 1) { MessageBox.Show("未选择干系人"); return; } if (string.IsNullOrEmpty(ProjectId)) { MessageHelper.ShowMsg(MessageID.W000000002, MessageType.Alert, "项目"); return; } if (string.IsNullOrEmpty(txtName.Text.ToString())) { MessageHelper.ShowMsg(MessageID.W000000001, MessageType.Alert, "姓名"); return; } #endregion var stakeholders = new Stakeholders(); stakeholders.ID = ID; stakeholders.CREATED = CREATED; stakeholders.CompanyName = txtCompanyName.Text.ToString(); stakeholders.Duty = txtDuty.Text.ToString(); stakeholders.Email = txtEmail.Text.ToString(); stakeholders.IsPublic = cbIspublic.CheckValue.ToString() == "Y" ? 1 : 0; stakeholders.Name = txtName.Text.ToString(); stakeholders.PID = ProjectId; stakeholders.Position = txtPosition.Text.ToString(); stakeholders.QQ = txtQQ.Text.ToString(); stakeholders.Tel = txtTel.Text.ToString(); stakeholders.Wechat = txtWechat.Text.ToString(); stakeholders.SendType = sendtype; stakeholders.Type = type; string _id = ""; JsonResult json = new StakeholdersBLL().SaveStakehoders(stakeholders, out _id); MessageHelper.ShowRstMsg(json.result); if (json.result) { ID = _id; } }
/// <summary> /// 选中 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void superGridControl1_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e) { var rows = superGridControl1.PrimaryGrid.GetSelectedRows(); if (rows.Count != 1) { MessageBox.Show("请选择一行"); superGridControl1.PrimaryGrid.ClearSelectedColumns(); return; } //清空 ClearAll(); GridRow row = (GridRow)rows[0]; Stakeholders stakeholders = new Stakeholders(); List <CommunicationFXFA> list = new List <CommunicationFXFA>(); bll.GetCommunicationMatix(ProjectId, row.Cells["ID"].Value.ToString(), out stakeholders, out list); if (stakeholders != null) { txtCompanyName.Text = stakeholders.CompanyName; txtDuty.Text = stakeholders.Duty; txtEmail.Text = stakeholders.Email; txtName.Text = stakeholders.Name; txtPosition.Text = stakeholders.Position; txtQQ.Text = stakeholders.QQ; txtTel.Text = stakeholders.Tel; txtWechat.Text = stakeholders.Wechat; cbIspublic.CheckValue = stakeholders.IsPublic; dtiCREATED.Value = stakeholders.CREATED; type = stakeholders.Type; sendtype = stakeholders.SendType; ID = stakeholders.ID; CREATED = stakeholders.CREATED; } if (list != null && list.Count > 0) { txtAddress1.Text = list[0].Addr; txtContent1.Text = list[0].Content; txtCommunicateDate1.Text = list[0].CommunicateDate; txtFrenquence1.Text = list[0].Frequency; DataHelper.SetComboBoxSelectItemByValue(cmbCommunication1, list[0].CID); FXFAID1 = list[0].ID; if (list.Count > 1) { txtAddress2.Text = list[1].Addr; txtContent2.Text = list[1].Content; txtConmunicateDate2.Text = list[0].CommunicateDate; txtFrenquence2.Text = list[0].Frequency; DataHelper.SetComboBoxSelectItemByValue(cmbCommunication2, list[1].CID); FXFAID2 = list[1].ID; } if (list.Count > 2) { txtAddress3.Text = list[2].Addr; txtContent3.Text = list[2].Content; txtConmunicateDate3.Text = list[0].CommunicateDate; txtFrenquence3.Text = list[0].Frequency; DataHelper.SetComboBoxSelectItemByValue(cmbCommunication3, list[2].CID); FXFAID3 = list[2].ID; } } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { #region 检查 if (string.IsNullOrEmpty(txtName.Text.ToString())) { MessageHelper.ShowMsg(MessageID.W000000001, MessageType.Alert, "姓名"); return; } int flag = 0; //没有选项目经理 string flagid = string.Empty; //项目经理id if (superGridControl1.PrimaryGrid.Rows.Count != 0) { foreach (var item in superGridControl1.PrimaryGrid.Rows) { string s = item.ToString(); s = s.Replace("{", ","); s = s.Replace("}", ","); string[] listS = s.Split(','); if (int.Parse(listS[13].Trim()) != 0) { flag = 1; flagid = listS[18].Trim(); } } } if (flag != 0 && cbIspublic.Checked && flagid != ID) { MessageBox.Show("不能存在多个项目经理"); return; } #endregion Stakeholders stakeholders = new Stakeholders(); stakeholders.CompanyName = txtCompanyName.Text.ToString(); stakeholders.Duty = txtDuty.Text.ToString(); stakeholders.Email = txtEmail.Text.ToString(); stakeholders.Position = txtPosition.Text.ToString(); stakeholders.QQ = txtQQ.Text.ToString(); stakeholders.Tel = txtTel.Text.ToString(); stakeholders.Wechat = txtWechat.Text.ToString(); //分类 ComboItem cbi = (ComboItem)cmbType.SelectedItem; if (cbi != null) { stakeholders.Type = Convert.ToInt32(cbi.Value); } stakeholders.Name = txtName.Text.ToString(); //项目经理 stakeholders.IsPublic = cbIspublic.Checked ? 1 : 0; //发送方式 ComboItem cbisend = (ComboItem)cmbSendType.SelectedItem; if (cbisend != null) { stakeholders.SendType = Convert.ToInt32(cbisend.Value); } stakeholders.Name = txtName.Text.ToString(); stakeholders.CREATED = CREATED; stakeholders.ID = ID; stakeholders.PID = ProjectId; string _id = ""; JsonResult json = bll.SaveStakehoders(stakeholders, out _id); //失败提示 if (!json.result) { MessageHelper.ShowRstMsg(json.result); } btnClear_Click(null, null); DataBind(null, null); }
private void LoadRequirements() { Stakeholder client = new Stakeholder("Заказчик", "Client"); Stakeholders.Add(client); Stakeholder users = new Stakeholder("Пользователи", "Users"); Stakeholders.Add(users); // Создание первого графа требований и модулей Requirement req1 = new Requirement("Вычисление квадратного уравнения", client, 60, 1); Requirement req11 = req1.AddSubRequirement("Ввод a, b, c", client, 60, 1); req11.AddSubModule("Input(a,b,c)", 100); Requirement req111 = req11.AddSubRequirement("Ввод целых числе a, b, c", users, 60, 2); req111.AddSubModule("Input(int a, int b, int c)", 100); Requirement req1111 = req111.AddSubRequirement("Ввод вещественных чисел a, b, c", users, 60, 3); req1111.AddSubModule("Input(double a, double b, double c)", 100); Requirement req12 = req1.AddSubRequirement("Решение квадратного уравнения", client, 60, 1); req12.AddSubModule("SolveEquation()", 100); req12.AddSubModule("Sum()", 50); req12.AddSubModule("Deduct()", 50); req12.AddSubModule("Mod()", 100); req12.AddSubModule("Div()", 100); req12.AddSubModule("Multiply()", 200); req12.AddSubModule("Sqrt()", 200); req12.AddSubModule("Pow()", 300, false); req12.AddSubModule("SolveInequality()", 100); Requirement req13 = req1.AddSubRequirement("Решение квадратного неравенство", client, 60, 2); req13.AddSubModule("Sum()", 50); req13.AddSubModule("Deduct()", 50); req13.AddSubModule("Mod()", 100); req13.AddSubModule("Div()", 100); req13.AddSubModule("Multiply()", 200); req13.AddSubModule("Sqrt()", 200); req13.AddSubModule("Pow()", 300, false); // Создание второго графа требований и модулей Requirement req2 = new Requirement("Проверка решения пользователя", client, 60, 1); Requirement req21 = req2.AddSubRequirement("Таймер (время на решение)", client, 60, 1); req21.AddSubModule("Timer()", 100); req21.AddSubRequirement("10 мин", users, 60, 2).AddSubModule("TimerRun(int 10)", 100); req21.AddSubRequirement("20 мин", users, 60, 2).AddSubModule("TimerRun(int 20)", 100); req21.AddSubRequirement("Отключение таймера", users, 60, 2, false).AddSubModule("TimerOff()", 100); Requirement req22 = req2.AddSubRequirement("Отображения ответа", client, 60, 1); req22.AddSubModule("Answer()", 100); req22.AddSubRequirement("С помощью графика", users, 60, 3).AddSubModule("ShowChart()", 100); req22.AddSubRequirement("С помощью формулы", users, 60, 3).AddSubModule("ShowFormula()", 100); req22.AddSubRequirement("Голосовое сообщение", users, 60, 3, false).AddSubModule("VoiceAnswer()", 100); req2.AddSubRequirement("Отображения решения", client, 60, 2).AddSubModule("Decision()", 100); // Создание третьего графа требований и модулей Requirement req3 = new Requirement("Статистика пользователей ", client, 60, 1); Requirement req31 = req3.AddSubRequirement("Кол-во решенных примеров", client, 60, 1); req31.AddSubModule("SuccessResult()", 100); req31.AddSubRequirement("Процент решенных примеров", users, 60, 2).AddSubModule("ProcentSuccessResult()", 100); req3.AddSubRequirement("Среднее время решения", client, 60, 2).AddSubModule("AverageSolving()", 100); // Добавление всех описанных требований в список требований Requirements.Add(req1); Requirements.Add(req2); Requirements.Add(req3); }