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 btnOK_Click(object sender, EventArgs e) { updateMission(); DataTable tDT = tmcMission.toDT(); tDT.Rows.RemoveAt(0); foreach (DataGridViewRow feDGVR in dgvExecutors.Rows) { tmcMission.Executor = AN_A[mscCtrl.toString(feDGVR.Cells["Executor"].Value)]; tmcMission.ExpDays = feDGVR.Cells["ExpDays"].Value == null ? "" : feDGVR.Cells["ExpDays"].Value.ToString(); tmcMission.Remark = mscCtrl.toString(feDGVR.Cells["Remark"].Value); DataTable feDT = tmcMission.toDT(); tDT.Merge(feDT); } if (tDT.Rows.Count == 1) { mscCtrl.uploadMissions(new mcMission(tDT.Rows[0]), "FmMission"); } else { mscCtrl.uploadMissions(tDT, "FmMission"); } }
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)); }