예제 #1
0
        /// <summary>
        /// 复制计划(重启计划)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolsTaskCopy_Click(object sender, EventArgs e)
        {
            DataGridViewCellCollection cells = this.dgvTaskPlan.Rows[MouseCurrentRowIndex].Cells;

            if (cells != null)
            {
                TaskEdit te = new TaskEdit(hotForm, this);
                te.Title         = "复制任务计划";
                te.hotGoodsText  = JsonConvert.DeserializeObject <List <GoodsTaskModel> >(cells["goodsText"].Value.ToString());
                te.hotPidsText   = JsonConvert.DeserializeObject <List <UserPidTaskModel> >(cells["pidsText"].Value.ToString());
                te.taskStartTime = cells["taskStartTime"].Value.ToString();
                te.taskTitle     = cells["taskTitle"].Value.ToString();
                te.taskEndTime   = cells["taskEndTime"].Value.ToString();
                te.ShowDialog(this);
            }
        }
예제 #2
0
        private void UpdateTask(DataGridViewCellCollection cells)
        {
            int eCode = 0;

            int.TryParse(cells["ExecStatus"].Value.ToString(), out eCode);
            if (eCode == 0)
            {
                //
                TaskEdit te = new TaskEdit(hotForm, this);
                te.Title = "修改任务计划";
                int result = 0;
                int.TryParse(cells["taskid"].Value.ToString(), out result);
                te.taskid        = result;
                te.taskStartTime = cells["taskStartTime"].Value.ToString();
                te.taskTitle     = cells["taskTitle"].Value.ToString();
                te.taskEndTime   = cells["taskEndTime"].Value.ToString();
                te.ShowDialog(this);
            }
            else
            {
                ShowAlert("只能修改[未执行]的任务");
            }
        }