123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.MarketingAllPerson.SetSmallForm
- {
- public partial class AddTeamPersonSmallForm : LYFZ.Software.UI.MarketingAllPerson.SetSmallForm.AddTeamPersonSmallForm
- {
- class SetCustomControls_TeamPersonColumnHeaderModel
- {
- private string _strTeamPersonID;
- private string _strDepartmentID;
- private string _strUserNumber;
- /// <summary>
- /// 队成员ID
- /// </summary>
- public string StrTeamPersonID
- {
- get { return _strTeamPersonID; }
- set { _strTeamPersonID = value; }
- }
- /// <summary>
- /// 部门ID
- /// </summary>
- public string StrDepartmentID
- {
- get { return _strDepartmentID; }
- set { _strDepartmentID = value; }
- }
- /// <summary>
- /// 员工编号
- /// </summary>
- public string StrUserNumber
- {
- get { return _strUserNumber; }
- set { _strUserNumber = value; }
- }
- }
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpTeamPersonSet tpsbll = new BLL.BLL_ErpTeamPersonSet();
- public AddTeamPersonSmallForm()
- {
- this.UcNavigationTool.LabTitle = "活动设置";
- this.Load += AddTeamPersonSmallForm_Load;
- this.Shown += AddTeamPersonSmallForm_Shown;
- this.Resize += AddTeamPersonSmallForm_Resize;
- this.cmbtreevActivityName.ComboBoxTree_NodeMouseClick += cmbtreevActivityName_ComboBoxTree_NodeMouseClick;
- this.cmbtreevMaxTeamName.ComboBoxTree_NodeMouseClick += cmbtreevMaxTeamName_ComboBoxTree_NodeMouseClick;
- this.cmbtreevMinTeamName.ComboBoxTree_NodeMouseClick += cmbtreevMinTeamName_ComboBoxTree_NodeMouseClick;
- this.btnSaveed.Click += btnSaveed_Click;
- this.btnClose.Click += btnClose_Click;
- this.btnAddActivity.Click += btnAddActivity_Click;
- this.btnAddMaxTeam.Click += btnAddMaxTeam_Click;
- this.btnAddMinTeam.Click += btnAddMinTeam_Click;
- this.btnAdding.Click += btnAdding_Click;
- this.btnRemove.Click += btnRemove_Click;
- this.listViewData_Source.MouseDoubleClick += listViewData_Source_MouseDoubleClick;
- this.listViewData_Person.MouseDoubleClick += listViewData_Person_MouseDoubleClick;
- this.txtText.Leave += txtText_Leave;
- this.txtText.KeyPress += txtText_KeyPress;
- }
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- /// <summary>
- /// 删除的人员
- /// </summary>
- Hashtable htDelete = new Hashtable();
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AddTeamPersonSmallForm_Load(object sender, EventArgs e)
- {
- this.lblMinTeamBaodiTask.Text = "0";
- this.lblMinTeamTargetTask.Text = "0";
- this.lblMinTeamSprintTask.Text = "0";
- this.lblAssignBaodiTask.Text = "0";
- this.lblAssignTargetTask.Text = "0";
- this.lblAssignSprintTask.Text = "0";
- ImageList mlistImage = new ImageList();
- this.listViewData_Source.View = View.Details;
- this.listViewData_Source.GridLines = true;
- string[] StrColumns = "员工姓名".Split(',');
- for (int i = 0; i < StrColumns.Length; i++)
- {
- ColumnHeader ch = new ColumnHeader();
- ch.Text = StrColumns[i].Trim();
- switch (StrColumns[i].Trim())
- {
- case "员工姓名": ch.Width = this.listViewData_Source.Width - 23; break;
- }
- ch.TextAlign = HorizontalAlignment.Center;
- this.listViewData_Source.Columns.Add(ch);
- }
- mlistImage.ImageSize = new Size(1, 25);
- mlistImage.ColorDepth = ColorDepth.Depth32Bit;
- this.listViewData_Source.SmallImageList = mlistImage;
- this.listViewData_Person.View = View.Details;
- this.listViewData_Person.GridLines = true;
- StrColumns = "员工姓名,大队名称,小组名称,保底任务,目标任务,冲刺任务".Split(',');
- for (int i = 0; i < StrColumns.Length; i++)
- {
- ColumnHeader ch = new ColumnHeader();
- ch.Text = StrColumns[i].Trim();
- switch (StrColumns[i].Trim())
- {
- case "员工姓名":
- case "大队名称":
- case "小组名称":
- case "保底任务":
- case "目标任务":
- case "冲刺任务": ch.Width = (this.listViewData_Person.Width - 23) / 6; break;
- }
- switch (StrColumns[i].Trim())
- {
- case "员工姓名":
- case "大队名称":
- case "小组名称": ch.TextAlign = HorizontalAlignment.Left;
- break;
- case "保底任务":
- case "目标任务":
- case "冲刺任务": ch.TextAlign = HorizontalAlignment.Center;
- break;
- }
- this.listViewData_Person.Columns.Add(ch);
- }
- mlistImage.ImageSize = new Size(1, 25);
- mlistImage.ColorDepth = ColorDepth.Depth32Bit;
- this.listViewData_Person.SmallImageList = mlistImage;
- ListViewGroup man_lvg = null;
- DataTable dt = orbll.GetView_Custom("tb_ErpDepartment", StrWhere: "", ShowColumnName: "ID,Dt_Name", filedOrder: "ID").Tables[0];
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- man_lvg = new ListViewGroup();
- man_lvg.Name = dt.Rows[i]["ID"].ToString().Trim();
- man_lvg.Header = dt.Rows[i]["Dt_Name"].ToString().Trim();
- man_lvg.HeaderAlignment = HorizontalAlignment.Left;
- this.listViewData_Source.Groups.Add(man_lvg);
- }
- man_lvg = new ListViewGroup();
- man_lvg.Name = "0";
- man_lvg.Header = "无部门";
- man_lvg.HeaderAlignment = HorizontalAlignment.Left;
- this.listViewData_Source.Groups.Add(man_lvg);
- this.listViewData_Source.ShowGroups = true;
- }
- /// <summary>
- ///获取当前未设置到活动下的所有员工
- /// </summary>
- void GetUserName()
- {
- this.listViewData_Source.Items.Clear();
- if (this.cmbtreevActivityName.Tag != null && !string.IsNullOrEmpty(this.cmbtreevActivityName.Tag.ToString().Trim()))
- {
- DataTable dtPerson = orbll.GetView_Custom("tb_ErpTeamPersonSet", StrWhere: "Tps_TasNumber = '" + this.cmbtreevActivityName.Tag.ToString().Trim() + "'", ShowColumnName: "Tps_UserNumber").Tables[0];
- DataTable dtUser = orbll.GetView_Custom("tb_ErpUser", StrWhere: "", ShowColumnName: "User_Name,User_EmployeeID,User_Department", filedOrder: "User_Department").Tables[0];
- for (int i = 0; i < dtUser.Rows.Count; i++)
- {
- if (dtPerson.Rows.Count > 0)
- {
- bool IsFind = false;
- for (int j = 0; j < dtPerson.Rows.Count; j++)
- {
- if (dtPerson.Rows[j]["Tps_UserNumber"].ToString().Trim() == dtUser.Rows[i]["User_EmployeeID"].ToString().Trim())
- {
- IsFind = true;
- dtPerson.Rows.RemoveAt(j);
- }
- }
- if (IsFind)
- { continue; }
- }
- ListViewItem lvItem = new ListViewItem();
- lvItem.Tag = dtUser.Rows[i]["User_EmployeeID"].ToString().Trim();
- lvItem.Text = dtUser.Rows[i]["User_Name"].ToString().Trim();
- if (this.listViewData_Source.Groups.Count > 0)
- {
- if (!string.IsNullOrEmpty(dtUser.Rows[i]["User_Department"].ToString().Trim()) && this.listViewData_Source.Groups[dtUser.Rows[i]["User_Department"].ToString().Trim()] != null)
- { this.listViewData_Source.Groups[dtUser.Rows[i]["User_Department"].ToString().Trim()].Items.Add(lvItem); }
- else
- { this.listViewData_Source.Groups["0"].Items.Add(lvItem); }
- }
- this.listViewData_Source.Items.Add(lvItem);
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Source);
- }
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AddTeamPersonSmallForm_Shown(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_TeamActivityName(this.cmbtreevActivityName);
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.全员营销);
- if (!b)
- {
- this.Close();
- }
- }
- /// <summary>
- /// 窗体大小发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void AddTeamPersonSmallForm_Resize(object sender, EventArgs e)
- {
- for (int i = 0; i < this.listViewData_Person.Columns.Count; i++)
- {
- this.listViewData_Person.Columns[i].Width = (this.listViewData_Person.Width - 23) / 6;
- }
- }
- /// <summary>
- /// 活动选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevActivityName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- this.cmbtreevMaxTeamName.Nodes.Clear();
- this.cmbtreevMinTeamName.Nodes.Clear();
- this.cmbtreevMaxTeamName.SetTextAndTag_ValueNull();
- this.cmbtreevMinTeamName.SetTextAndTag_ValueNull();
- this.listViewData_Person.Items.Clear();
- this.lblMinTeamBaodiTask.Text = "0";
- this.lblMinTeamTargetTask.Text = "0";
- this.lblMinTeamSprintTask.Text = "0";
- this.lblAssignBaodiTask.Text = "0";
- this.lblAssignTargetTask.Text = "0";
- this.lblAssignSprintTask.Text = "0";
- if (!string.IsNullOrEmpty(this.cmbtreevActivityName.Text.Trim()))
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_TeamMaxTaskName(this.cmbtreevMaxTeamName, this.cmbtreevActivityName.Tag.ToString().Trim());
- this.GetUserName();
- }
- }
- /// <summary>
- /// 大队选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevMaxTeamName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- this.listViewData_Person.Items.Clear();
- this.lblMinTeamBaodiTask.Text = "0";
- this.lblMinTeamTargetTask.Text = "0";
- this.lblMinTeamSprintTask.Text = "0";
- this.lblAssignBaodiTask.Text = "0";
- this.lblAssignTargetTask.Text = "0";
- this.lblAssignSprintTask.Text = "0";
- this.cmbtreevMinTeamName.SetTextAndTag_ValueNull();
- this.cmbtreevMinTeamName.Nodes.Clear();
- if (!string.IsNullOrEmpty(this.cmbtreevActivityName.Text.Trim()) && !string.IsNullOrEmpty(this.cmbtreevMaxTeamName.Text.Trim()))
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_TeamMinTaskName(this.cmbtreevMinTeamName, this.cmbtreevActivityName.Tag.ToString().Trim(), this.cmbtreevMaxTeamName.Tag.ToString().Trim(), IsFirstNodeNull: true, IsFirstNodeName: "全部");
- this.GetMinGroupUserName();
- this.GetUserName();
- DataTable dt = orbll.GetView_Custom("tb_ErpTeamMaxTaskSet", StrWhere: "Tmxt_Number = '" + this.cmbtreevMaxTeamName.StrGetName.Trim() + "'", ShowColumnName: "Tmxt_BaodiTask,Tmxt_TargetTask,Tmxt_SprintTask").Tables[0];
- if (dt.Rows.Count > 0)
- {
- this.lblMinTeamBaodiTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dt.Rows[0]["Tmxt_BaodiTask"]);
- this.lblMinTeamTargetTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dt.Rows[0]["Tmxt_TargetTask"]);
- this.lblMinTeamSprintTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dt.Rows[0]["Tmxt_SprintTask"]);
- }
- }
- }
- /// <summary>
- /// 小组选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevMinTeamName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- DataTable dtSmallTeam = orbll.GetView_Custom("tb_ErpTeamMinTaskSet", StrWhere: "Tmit_TasNumber = '" + this.cmbtreevActivityName.Tag.ToString().Trim() + "' And Tmit_TmxnNumber = '" + this.cmbtreevMaxTeamName.Tag.ToString().Trim() + "' And Tmit_TminNumber = '" + this.cmbtreevMinTeamName.Tag.ToString().Trim() + "'", ShowColumnName: "Tmit_BaodiTask,Tmit_TargetTask,Tmit_SprintTask").Tables[0];
- if (dtSmallTeam.Rows.Count > 0)
- {
- this.lblMinTeamBaodiTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtSmallTeam.Rows[0]["Tmit_BaodiTask"]);
- this.lblMinTeamTargetTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtSmallTeam.Rows[0]["Tmit_TargetTask"]);
- this.lblMinTeamSprintTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(dtSmallTeam.Rows[0]["Tmit_SprintTask"]);
- }
- else
- {
- this.lblMinTeamBaodiTask.Text = "0";
- this.lblMinTeamTargetTask.Text = "0";
- this.lblMinTeamSprintTask.Text = "0";
- }
- this.GetMinGroupUserName();
- this.GetUserName();
- }
- /// <summary>
- /// 获取小组成员
- /// </summary>
- void GetMinGroupUserName()
- {
- decimal deBaodiTask = 0;
- decimal deTargetTask = 0;
- decimal deSprintTask = 0;
- this.listViewData_Person.Items.Clear();
- this.listViewData_Person.Groups.Clear();
- string StrWhere = "";
- if (this.cmbtreevMinTeamName.Tag != null && !string.IsNullOrEmpty(this.cmbtreevMinTeamName.Tag.ToString().Trim()) && this.cmbtreevMinTeamName.Text.Trim() != "全部")
- { StrWhere += " And Tps_TminNumber = '" + this.cmbtreevMinTeamName.Tag.ToString().Trim() + "'"; }
- DataTable dtGroup = orbll.GetView_Custom("tb_ErpTeamPersonSet Left Join tb_ErpTeamMinNameSet on Tmin_Number = Tps_TminNumber", StrWhere: "Tps_TasNumber = '" + this.cmbtreevActivityName.Tag.ToString().Trim() + "' And Tps_TmxnNumber = '" + this.cmbtreevMaxTeamName.Tag.ToString().Trim() + "'" + StrWhere, ShowColumnName: "Tps_TminNumber,Tmin_Name").Tables[0];
- DataTable dt = orbll.GetView_Custom("tb_ErpTeamPersonSet Left Join tb_ErpUser on User_EmployeeID = Tps_UserNumber Left Join tb_ErpTeamMinNameSet on Tmin_Number = Tps_TminNumber", StrWhere: "Tps_TasNumber = '" + this.cmbtreevActivityName.Tag.ToString().Trim() + "' And Tps_TmxnNumber = '" + this.cmbtreevMaxTeamName.Tag.ToString().Trim() + "'" + StrWhere, ShowColumnName: "tb_ErpTeamPersonSet.ID,Tps_TminNumber,User_EmployeeID,User_Name,User_Department,Tmin_Name,Tps_BaodiTask,Tps_TargetTask,Tps_SprintTask").Tables[0];
- if (dtGroup.Rows.Count > 1)
- {
- ListViewGroup man_lvg = null;
- for (int i = 0; i < dtGroup.Rows.Count; i++)
- {
- man_lvg = new ListViewGroup();
- man_lvg.Name = dtGroup.Rows[i]["Tps_TminNumber"].ToString().Trim();
- man_lvg.Header = dtGroup.Rows[i]["Tmin_Name"].ToString().Trim();
- man_lvg.HeaderAlignment = HorizontalAlignment.Left;
- this.listViewData_Person.Groups.Add(man_lvg);
- }
- this.listViewData_Person.ShowGroups = true;
- }
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- ListViewItem lvItem = new ListViewItem();
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = new SetCustomControls_TeamPersonColumnHeaderModel();
- ColumnModel.StrTeamPersonID = dt.Rows[i]["ID"].ToString().Trim();
- ColumnModel.StrDepartmentID = dt.Rows[i]["User_Department"].ToString().Trim();
- ColumnModel.StrUserNumber = dt.Rows[i]["User_EmployeeID"].ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.Text = dt.Rows[i]["User_Name"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "大队名称";
- ListSubItem.Text = this.cmbtreevMaxTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "小组名称";
- ListSubItem.Text = dt.Rows[i]["Tmin_Name"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "保底任务";
- ListSubItem.Text = dt.Rows[i]["Tps_BaodiTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- deBaodiTask += Convert.ToDecimal(dt.Rows[i]["Tps_BaodiTask"]);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "目标任务";
- ListSubItem.Text = dt.Rows[i]["Tps_TargetTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- deTargetTask += Convert.ToDecimal(dt.Rows[i]["Tps_TargetTask"]);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "冲刺任务";
- ListSubItem.Text = dt.Rows[i]["Tps_SprintTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- deSprintTask += Convert.ToDecimal(dt.Rows[i]["Tps_SprintTask"]);
- if (this.listViewData_Person.Groups.Count > 0)
- { this.listViewData_Person.Groups[dt.Rows[i]["Tps_TminNumber"].ToString().Trim()].Items.Add(lvItem); }
- this.listViewData_Person.Items.Add(lvItem);
- }
- this.lblAssignBaodiTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(deBaodiTask);
- this.lblAssignTargetTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(deTargetTask);
- this.lblAssignSprintTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(deSprintTask);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Person);
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSaveed_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Person.Items.Count > 0)
- {
- if ((Convert.ToDecimal(this.lblAssignBaodiTask.Text.Trim()) - Convert.ToDecimal(this.lblMinTeamBaodiTask.Text.Trim())) > 0)
- { MessageBoxCustom.Show("小组成员总保底任务不能大于小组保底任务!"); return; }
- if ((Convert.ToDecimal(this.lblAssignTargetTask.Text.Trim()) - Convert.ToDecimal(this.lblMinTeamTargetTask.Text.Trim())) > 0)
- { MessageBoxCustom.Show("小组成员总目标任务不能大于小组目标任务!"); return; }
- if ((Convert.ToDecimal(this.lblAssignSprintTask.Text.Trim()) - Convert.ToDecimal(this.lblMinTeamSprintTask.Text.Trim())) > 0)
- { MessageBoxCustom.Show("小组成员总冲刺任务不能大于小组冲刺任务!"); return; }
- DateTime StrTime = SDateTime.Now;
- string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- LYFZ.Model.Model_ErpTeamPersonSet model = null;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- for (int i = 0; i < this.listViewData_Person.Items.Count; i++)
- {
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = (SetCustomControls_TeamPersonColumnHeaderModel)this.listViewData_Person.Items[i].Tag;
- if (string.IsNullOrEmpty(ColumnModel.StrTeamPersonID.Trim()))
- {
- model = new Model.Model_ErpTeamPersonSet();
- model.Tps_Number = "MPS_" + LYFZ.WinAPI.CustomPublicMethod.GenerateId().ToString().Trim();
- model.Tps_TasNumber = this.cmbtreevActivityName.Tag.ToString().Trim();
- model.Tps_TmxnNumber = this.cmbtreevMaxTeamName.Tag.ToString().Trim();
- model.Tps_TmxtNumber = this.cmbtreevMaxTeamName.StrGetName.Trim();
- model.Tps_TminNumber = this.cmbtreevMinTeamName.Tag.ToString().Trim();
- model.Tps_TmitNumber = this.cmbtreevMinTeamName.StrGetName.Trim();
- model.Tps_UserNumber = ColumnModel.StrUserNumber.Trim();
- model.Tps_BaodiTask = Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["保底任务"].Text.Trim());
- model.Tps_TargetTask = Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["目标任务"].Text.Trim());
- model.Tps_SprintTask = Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["冲刺任务"].Text.Trim());
- model.Tps_TeamLeader = 0;
- model.Tps_GroupLeader = 0;
- model.Tps_CreateDateTime = StrTime;
- model.Tps_CreateName = StrUserID;
- clist.Add(tpsbll.GetAddCommandInfo(model));
- }
- else
- {
- model = tpsbll.GetModel(Convert.ToInt32(ColumnModel.StrTeamPersonID));
- model.Tps_BaodiTask = Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["保底任务"].Text.Trim());
- model.Tps_TargetTask = Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["目标任务"].Text.Trim());
- model.Tps_SprintTask = Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["冲刺任务"].Text.Trim());
- model.Tps_TeamLeader = 0;
- model.Tps_GroupLeader = 0;
- model.Tps_UpdateDateTime = StrTime;
- model.Tps_UpdateName = StrUserID;
- clist.Add(tpsbll.GetUpdateCommandInfo(model));
- }
- }
- foreach (DictionaryEntry item in htDelete)
- {
- clist.Add(tpsbll.GetDeleteCommandInfo("ID", "=", item.Key.ToString().Trim()));
- }
- if (clist.Count > 0)
- {
- if (MessageBoxCustom.Show("您确定要保存吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- {
- this.htDelete.Clear();
- this.IsSaveed = true;
- MessageBoxCustom.Show("保存成功!");
- this.GetMinGroupUserName();
- }
- else
- { MessageBoxCustom.Show("保存失败!"); }
- }
- }
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 设置活动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAddActivity_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.MarketingAllPerson.SetSmallForm.AddNewActiveSmallForm frm = new AddNewActiveSmallForm();
- frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.AddTeamPersonSmallForm_Shown(this, null); }
- }
- /// <summary>
- /// 设置大队
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAddMaxTeam_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.MarketingAllPerson.SetSmallForm.AddMaxTeamSmallForm frm = new AddMaxTeamSmallForm();
- frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.cmbtreevActivityName_ComboBoxTree_NodeMouseClick(this, null); }
- }
- /// <summary>
- /// 设置小组
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAddMinTeam_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.MarketingAllPerson.SetSmallForm.AddMinTeamSmallForm frm = new AddMinTeamSmallForm();
- frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.cmbtreevMaxTeamName_ComboBoxTree_NodeMouseClick(this, null); }
- }
- /// <summary>
- /// 添加人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAdding_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Source.Items.Count > 0 && this.listViewData_Source.SelectedItems.Count > 0)
- {
- if (string.IsNullOrEmpty(this.cmbtreevActivityName.Text.Trim()))
- { MessageBoxCustom.Show("请选择活动名称"); return; }
- if (string.IsNullOrEmpty(this.cmbtreevMaxTeamName.Text.Trim()))
- { MessageBoxCustom.Show("请选择大队名称"); return; }
- if (this.cmbtreevMinTeamName.Tag == null || string.IsNullOrEmpty(this.cmbtreevMinTeamName.Tag.ToString().Trim()))
- { MessageBoxCustom.Show("请选择小组名称"); return; }
- string StrSql = "";
- List<ListViewItem> delist = new List<ListViewItem>();
- for (int i = 0; i < this.listViewData_Source.SelectedItems.Count; i++)
- {
- StrSql += "'" + this.listViewData_Source.SelectedItems[i].Tag.ToString().Trim() + "',";
- delist.Add(this.listViewData_Source.SelectedItems[i]);
- }
- if (!string.IsNullOrEmpty(StrSql))
- { StrSql = "And Tps_UserNumber in(" + StrSql.TrimEnd(',') + ")"; }
- string StrWhere = "Tps_TasNumber = '" + this.cmbtreevActivityName.Tag.ToString().Trim() + "' And Tps_TmxtNumber = '" + this.cmbtreevMaxTeamName.Tag.ToString().Trim() + "' And Tps_TmitNumber = '" + this.cmbtreevMinTeamName.Tag.ToString().Trim() + "' " + StrSql;
- string StrFildName = "ID,Tps_TasNumber,Tps_TmxnNumber,Tps_TmxtNumber,Tps_TminNumber,Tps_TmitNumber,Tps_UserNumber,Tps_BaodiTask,Tps_TargetTask,Tps_SprintTask,Tps_TeamLeader,Tps_GroupLeader";
- DataTable dt = orbll.GetView_Custom("tb_ErpTeamPersonSet", StrWhere: StrWhere, ShowColumnName: StrFildName).Tables[0];
- for (int i = 0; i < this.listViewData_Source.SelectedItems.Count; i++)
- {
- bool IsFind = false;
- if (dt.Rows.Count > 0)
- {
- DataRow[] dtRow = dt.Select("Tps_UserNumber = '" + this.listViewData_Source.SelectedItems[i].Tag.ToString().Trim() + "'");
- if (dtRow.Length > 0)
- {
- ListViewItem lvItem = new ListViewItem();
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = new SetCustomControls_TeamPersonColumnHeaderModel();
- ColumnModel.StrTeamPersonID = dtRow[0]["ID"].ToString().Trim();
- ColumnModel.StrDepartmentID = dtRow[0]["User_Department"].ToString().Trim();
- ColumnModel.StrUserNumber = dtRow[0]["User_EmployeeID"].ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.Text = dtRow[0]["User_Name"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "大队名称";
- ListSubItem.Text = this.cmbtreevMaxTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "小组名称";
- ListSubItem.Text = this.cmbtreevMinTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "保底任务";
- ListSubItem.Text = dtRow[0]["Tps_BaodiTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "目标任务";
- ListSubItem.Text = dtRow[0]["Tps_TargetTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "冲刺任务";
- ListSubItem.Text = dtRow[0]["Tps_SprintTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- if (this.listViewData_Person.Groups.Count > 0)
- { this.listViewData_Person.Groups[this.cmbtreevMinTeamName.Tag.ToString().Trim()].Items.Add(lvItem); }
- this.listViewData_Person.Items.Add(lvItem);
- IsFind = true;
- }
- }
- if (!IsFind)
- {
- ListViewItem lvItem = new ListViewItem();
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = new SetCustomControls_TeamPersonColumnHeaderModel();
- ColumnModel.StrTeamPersonID = "";
- ColumnModel.StrDepartmentID = this.listViewData_Source.SelectedItems[i].Group.Name.Trim();
- ColumnModel.StrUserNumber = this.listViewData_Source.SelectedItems[i].Tag.ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.Text = this.listViewData_Source.SelectedItems[i].Text.Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "大队名称";
- ListSubItem.Text = this.cmbtreevMaxTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "小组名称";
- ListSubItem.Text = this.cmbtreevMinTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "保底任务";
- ListSubItem.Text = "0";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "目标任务";
- ListSubItem.Text = "0";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "冲刺任务";
- ListSubItem.Text = "0";
- lvItem.SubItems.Add(ListSubItem);
- if (this.listViewData_Person.Groups.Count > 0)
- { this.listViewData_Person.Groups[this.cmbtreevMinTeamName.Tag.ToString().Trim()].Items.Add(lvItem); }
- this.listViewData_Person.Items.Add(lvItem);
- }
- }
- for (int i = 0; i < delist.Count; i++)
- { this.listViewData_Source.Items.Remove(delist[i]); }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Source);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Person);
- this.GetAssignAmount();
- }
- }
- /// <summary>
- /// 移除人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnRemove_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Person.Items.Count > 0 && this.listViewData_Person.SelectedItems.Count > 0)
- {
- List<ListViewItem> delist = new List<ListViewItem>();
- for (int i = 0; i < this.listViewData_Person.SelectedItems.Count; i++)
- {
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = (SetCustomControls_TeamPersonColumnHeaderModel)this.listViewData_Person.SelectedItems[i].Tag;
- ListViewItem lvItem = new ListViewItem();
- lvItem.Tag = ColumnModel.StrUserNumber.Trim();
- lvItem.Text = this.listViewData_Person.SelectedItems[i].Text.Trim();
- this.listViewData_Source.Groups[ColumnModel.StrDepartmentID.Trim()].Items.Add(lvItem);
- this.listViewData_Source.Items.Add(lvItem);
- delist.Add(this.listViewData_Person.SelectedItems[i]);
- if (!string.IsNullOrEmpty(ColumnModel.StrTeamPersonID.Trim()))
- { htDelete[ColumnModel.StrTeamPersonID.Trim()] = ColumnModel; }
- }
- for (int i = 0; i < delist.Count; i++)
- { this.listViewData_Person.Items.Remove(delist[i]); }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Source);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Person);
- this.GetAssignAmount();
- }
- }
- /// <summary>
- /// 双击添加人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Source_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- if (this.listViewData_Source.Items.Count > 0 && this.listViewData_Source.SelectedItems.Count > 0)
- {
- if (string.IsNullOrEmpty(this.cmbtreevActivityName.Text.Trim()))
- { MessageBoxCustom.Show("请选择活动名称"); return; }
- if (string.IsNullOrEmpty(this.cmbtreevMaxTeamName.Text.Trim()))
- { MessageBoxCustom.Show("请选择大队名称"); return; }
- if (string.IsNullOrEmpty(this.cmbtreevMinTeamName.Text.Trim()) || this.cmbtreevMinTeamName.Tag == null)
- { MessageBoxCustom.Show("请选择小组名称"); return; }
- if (this.cmbtreevMinTeamName.Tag == null || string.IsNullOrEmpty(this.cmbtreevMinTeamName.Tag.ToString().Trim()))
- { MessageBoxCustom.Show("请选择小组名称"); return; }
- DataTable dt = orbll.GetView_Custom("tb_ErpTeamPersonSet", StrWhere: "Tps_TasNumber = '" + this.cmbtreevActivityName.Tag.ToString().Trim() + "' And Tps_TmxtNumber = '" + this.cmbtreevMaxTeamName.Tag.ToString().Trim() + "' And Tps_TmitNumber = '" + this.cmbtreevMinTeamName.Tag.ToString().Trim() + "' And Tps_UserNumber = '" + this.listViewData_Source.SelectedItems[0].Tag.ToString().Trim() + "'", ShowColumnName: "*").Tables[0];
- if (dt.Rows.Count > 0)
- {
- ListViewItem lvItem = new ListViewItem();
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = new SetCustomControls_TeamPersonColumnHeaderModel();
- ColumnModel.StrTeamPersonID = dt.Rows[0]["ID"].ToString().Trim();
- ColumnModel.StrDepartmentID = dt.Rows[0]["User_Department"].ToString().Trim();
- ColumnModel.StrUserNumber = dt.Rows[0]["User_EmployeeID"].ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.Text = dt.Rows[0]["User_Name"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "大队名称";
- ListSubItem.Text = this.cmbtreevMaxTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "小组名称";
- ListSubItem.Text = this.cmbtreevMinTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "保底任务";
- ListSubItem.Text = dt.Rows[0]["Tps_BaodiTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "目标任务";
- ListSubItem.Text = dt.Rows[0]["Tps_TargetTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "冲刺任务";
- ListSubItem.Text = dt.Rows[0]["Tps_SprintTask"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- if (this.listViewData_Person.Groups.Count > 0)
- { this.listViewData_Person.Groups[this.cmbtreevMinTeamName.Tag.ToString().Trim()].Items.Add(lvItem); }
- this.listViewData_Person.Items.Add(lvItem);
- }
- else
- {
- ListViewItem lvItem = new ListViewItem();
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = new SetCustomControls_TeamPersonColumnHeaderModel();
- ColumnModel.StrTeamPersonID = "";
- ColumnModel.StrDepartmentID = this.listViewData_Source.SelectedItems[0].Group.Name.Trim();
- ColumnModel.StrUserNumber = this.listViewData_Source.SelectedItems[0].Tag.ToString().Trim();
- lvItem.Tag = ColumnModel;
- lvItem.Text = this.listViewData_Source.SelectedItems[0].Text.Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "大队名称";
- ListSubItem.Text = this.cmbtreevMaxTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "小组名称";
- ListSubItem.Text = this.cmbtreevMinTeamName.Text.Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "保底任务";
- ListSubItem.Text = "0";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "目标任务";
- ListSubItem.Text = "0";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "冲刺任务";
- ListSubItem.Text = "0";
- lvItem.SubItems.Add(ListSubItem);
- if (this.listViewData_Person.Groups.Count > 0)
- { this.listViewData_Person.Groups[this.cmbtreevMinTeamName.Tag.ToString().Trim()].Items.Add(lvItem); }
- this.listViewData_Person.Items.Add(lvItem);
- this.listViewData_Source.Items.Remove(this.listViewData_Source.SelectedItems[0]);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Source);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Person);
- }
- this.GetAssignAmount();
- }
- }
- /// <summary>
- /// 双击移除人员及设置任务
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Person_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- this.txtText.Visible = false;
- if (this.listViewData_Person.Items.Count > 0 && this.listViewData_Person.SelectedItems.Count > 0)
- {
- bool IsFind = false;
- ListViewHitTestInfo info = this.listViewData_Person.HitTest(e.X, e.Y);
- if (!string.IsNullOrEmpty(info.SubItem.Name.Trim()))
- {
- Rectangle rect = info.SubItem.Bounds;
- switch (info.SubItem.Name.Trim())
- {
- case "保底任务":
- case "目标任务":
- case "冲刺任务":
- IsFind = true;
- this.txtText.Location = new Point(rect.Location.X + this.listViewData_Person.Location.X + 3, rect.Location.Y + this.listViewData_Person.Location.Y + 2);
- this.txtText.Size = rect.Size;
- this.txtText.Visible = true;
- this.txtText.Tag = info.SubItem.Name.Trim();
- this.txtText.Text = info.SubItem.Text.Trim();
- this.txtText.Focus();
- break;
- }
- }
- if (!IsFind)
- {
- SetCustomControls_TeamPersonColumnHeaderModel ColumnModel = (SetCustomControls_TeamPersonColumnHeaderModel)this.listViewData_Person.SelectedItems[0].Tag;
- ListViewItem lvItem = new ListViewItem();
- lvItem.Tag = ColumnModel.StrUserNumber.Trim();
- lvItem.Text = this.listViewData_Person.SelectedItems[0].Text.Trim();
- this.listViewData_Source.Groups[ColumnModel.StrDepartmentID.Trim()].Items.Add(lvItem);
- if (!string.IsNullOrEmpty(ColumnModel.StrTeamPersonID.Trim()))
- { htDelete[ColumnModel.StrTeamPersonID.Trim()] = ColumnModel; }
- this.listViewData_Source.Items.Add(lvItem);
- this.listViewData_Person.Items.Remove(this.listViewData_Person.SelectedItems[0]);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Source);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Person);
- this.GetAssignAmount();
- }
- }
- }
- /// <summary>
- /// 文本框离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtText_Leave(object sender, EventArgs e)
- {
- try
- {
- if (this.txtText.Tag != null)
- {
- switch (this.txtText.Tag.ToString().Trim())
- {
- case "保底任务":
- case "目标任务":
- case "冲刺任务":
- if (string.IsNullOrEmpty(this.txtText.Text.Trim()))
- { break; }
- if (!LYFZ.Command.Command_Validate.IsNumberSign(this.txtText.Text.Trim()))
- { break; }
- if (Convert.ToInt32(this.txtText.Text.Trim()) <= 0)
- { break; }
- this.listViewData_Person.SelectedItems[0].SubItems[this.txtText.Tag.ToString().Trim()].Text = Convert.ToDecimal(this.txtText.Text).ToString();
- this.GetAssignAmount();
- break;
- }
- }
- }
- catch
- { }
- this.txtText.Visible = false;
- }
- /// <summary>
- /// 文本框输入限制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtText_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[0-9]") && e.KeyChar != ' ' && e.KeyChar != '\b')
- { e.Handled = true; }
- }
- /// <summary>
- /// 统计已分金额
- /// </summary>
- void GetAssignAmount()
- {
- decimal deBaodiTask = 0;
- decimal deTargetTask = 0;
- decimal deSprintTask = 0;
- for (int i = 0; i < this.listViewData_Person.Items.Count; i++)
- {
- deBaodiTask += Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["保底任务"].Text.Trim());
- deTargetTask += Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["目标任务"].Text.Trim());
- deSprintTask += Convert.ToDecimal(this.listViewData_Person.Items[i].SubItems["冲刺任务"].Text.Trim());
- }
- this.lblAssignBaodiTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(deBaodiTask);
- this.lblAssignTargetTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(deTargetTask);
- this.lblAssignSprintTask.Text = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero(deSprintTask);
- }
- }
- }
|