Пример #1
0
        public void GetMission(DataRow pDR)
        {
            mcMission tmM = new mcMission(pDR);

            Missions.Add(tmM);
            keyToMission.Add(tmM.Key, tmM);
        }
Пример #2
0
 private void showFmMission(mcMission pmM = null)
 {
     mscCtrl.fmMission = new FmMission(pmM);
     if (mscCtrl.fmMission.ShowDialog() == DialogResult.Yes)
     {
         Flash_Missions();
     }
 }
Пример #3
0
        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++;
        }
Пример #4
0
        private void editMission()
        {
            mcMission tmM = getCurrentMission();

            if (tmM == null)
            {
                return;
            }
            showFmMission(tmM);
        }
Пример #5
0
 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);
 }
Пример #6
0
        private void btnAllHandOver_Click(object sender, EventArgs e)
        {
            mcMission tmM = getCurrentMission();

            if (tmM == null)
            {
                return;
            }
            tmM.Status = "全部已交接";
            mscCtrl.uploadMissions(tmM, "FmMain");
        }
Пример #7
0
        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");
            }
        }
Пример #8
0
        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");
            }
        }
Пример #9
0
        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;
            }
        }
Пример #10
0
        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();
        }
Пример #11
0
 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();
 }
Пример #12
0
        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);
        }
Пример #13
0
        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));
        }