public void GetMission(DataRow pDR) { mcMission tmM = new mcMission(pDR); Missions.Add(tmM); keyToMission.Add(tmM.Key, tmM); }
private void showFmMission(mcMission pmM = null) { mscCtrl.fmMission = new FmMission(pmM); if (mscCtrl.fmMission.ShowDialog() == DialogResult.Yes) { Flash_Missions(); } }
private static void add_msDGV(mcMission pmM, DataGridView pDGV, ref int pIdx) { pDGV.Rows.Add(); var currentRow = pDGV.Rows[pIdx]; mscCtrl.setStatusBar(pmM, currentRow); pIdx++; }
private void editMission() { mcMission tmM = getCurrentMission(); if (tmM == null) { return; } showFmMission(tmM); }
public static void setStatusBar(mcMission pmM, DataGridViewRow pDGVR) { pDGVR.Cells["Name"].Value = pmM.Name == string.Empty ? pmM.ProjectName : pmM.Name; if (pmM.DateCreate != "" && ((DateTime.Now - Convert.ToDateTime(pmM.DateCreate)).Days * 24 <= 24)) { pDGVR.Cells["Name"].Value = "*" + pDGVR.Cells["Name"].Value; } pDGVR.Tag = pmM.toDT().Rows[0];//pmM.Key; setStatusBar(pmM.Busy, pDGVR); }
private void btnAllHandOver_Click(object sender, EventArgs e) { mcMission tmM = getCurrentMission(); if (tmM == null) { return; } tmM.Status = "全部已交接"; mscCtrl.uploadMissions(tmM, "FmMain"); }
private void btnDeleteMission_Click(object sender, EventArgs e) { mcMission tmM = getCurrentMission(); if (tmM == null) { return; } if (MessageBox.Show("确定要删除该任务?", "missions", MessageBoxButtons.OKCancel) == DialogResult.OK) { mscCtrl.deleteMission(tmM.Key, "FmMain"); } }
private void btnFinishMission_Click(object sender, EventArgs e) { mcMission tmM = getCurrentMission(); if (tmM == null) { return; } if (MessageBox.Show("任务已完成?", "missions", MessageBoxButtons.OKCancel) == DialogResult.OK) { tmM.Status = "已完成"; mscCtrl.uploadMissions(tmM, "FmMain"); } }
private void flash_dgvMissionInfo() { mcMission tmM = getCurrentMission(); if (tmM == null) { dgvMissionInfo.DataSource = null; //crtMissionKey = string.Empty; } else { dgvMissionInfo.DataSource = mscCtrl.transpose(tmM.toTinyDT()); crtMissionKey = tmM.Key; } }
public FmMission(mcMission pmM) { InitializeComponent(); setDGV(); tmcMission = pmM == null ? new mcMission() : pmM; if (tmcMission.Key != string.Empty) { this.Text = "编辑任务"; btnPlus.Visible = false; btnMinus.Visible = false; } displayMission(); }
public void FillMissions(DataTable pDT) { foreach (mcStaff femS in staffs.Values) { femS.ClearMissions(); } foreach (DataRow feDR in pDT.Rows) { mcMission tmM = new mcMission(feDR); var t = tmM.Executor; staffs[tmM.Executor].GetMission(feDR); } flash_msdgvStaffBar(); flash_msdgvMission(); flash_dgvMissionInfo(); }
private void btnCopyMission_Click(object sender, EventArgs e) { mcMission tmM = getCurrentMission(); if (tmM == null) { return; } DataTable tDT = tmM.toDT(); DataRow tDR = tDT.Rows[0]; tDR["Key"] = string.Empty; tDR["Executor"] = mscCtrl.Me.Account; tDR["ExpDays"] = ""; tDR["Remark"] = string.Empty; tDR["Date_Create"] = DateTime.Now.ToString(mscCtrl.DateFomate); tDR["Creator"] = mscCtrl.Me.Account; mcMission nmM = new mcMission(tDR); showFmMission(nmM); }
public static void uploadMissions(mcMission pmM, string pFm = "FmMain") { if (pmM.Status == "已完成") { if (MessageBox.Show("该任务是否包含生产成果?", "missions", MessageBoxButtons.YesNo) == DialogResult.Yes) { FmInputBox fmInputBox1 = new missions.FmInputBox("数据录入", "请输入 建安工程费(单位:万元):", pmM.WorkCost); if (fmInputBox1.ShowDialog() == DialogResult.OK) { pmM.WorkCost = fmInputBox1.InputStr; } FmInputBox fmInputBox2 = new missions.FmInputBox("数据录入", "请输入 综合(设计)费(单位:万元):", pmM.Fee); if (fmInputBox2.ShowDialog() == DialogResult.OK) { pmM.Fee = fmInputBox2.InputStr; } } } DataTable tDT = pmM.toDT(); socket.Send(addTableHead("uploadMissions", false, string.Empty, pFm, tDT)); }