Пример #1
0
 protected void gvProject_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     // 将任务置为完成
     if (e.CommandName == "setFinished")
     {
         string  prjId = e.CommandArgument.ToString();
         Project prj   = new ProjectBLL().GetModel(prjId);
         prj.ISFINISHED = 1;
         new ProjectBLL().Update(prj);
         LoadProject();
         ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "alert('设置成功!');", true);
     }
     // 将修改任务置为完成
     else if (e.CommandName == "setModifyFinished")
     {
         ProjectBLL pBll      = new ProjectBLL();
         string[]   args      = e.CommandArgument.ToString().Split('|');
         string     projectID = args[0];
         string     modfItem  = args[1];
         Project    project   = pBll.GetModel(projectID);
         // 查询修改任务的完成稿是否存在
         bool isExistFinalModifyScript = pBll.IsExistFinalModifyScript(projectID, modfItem);
         if (!isExistFinalModifyScript)
         {
             bool addFlag = pBll.AddProjectModify(projectID, modfItem, 1, 1, DateTime.Now);
             if (addFlag)
             {
                 LogHelper.WriteLine(string.Format("【Success】ID【{0}】任务修改记录的完成稿【{1}】创建成功", projectID, modfItem));
                 if (!trBll.IsExist(project.ENTERINGPERSON, project.TASKNO, modfItem, "1", "1"))
                 {
                     int addTaskRemindingFlag = trBll.Add(EmployeeNo, project.ENTERINGPERSON, project.TASKNO, modfItem, "0", DateTime.Now.ToString(), null, "1", "1", "1");
                     if (addTaskRemindingFlag > 0)
                     {
                         LoadProject();
                         ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "alert('设置成功!');", true);
                         LogHelper.WriteLine(string.Format("【任务监控】售后完成任务【{0}】-【{1}】的提醒添加成功", project.TASKNO, modfItem));
                         return;
                     }
                 }
             }
             else
             {
                 LogHelper.WriteLine(string.Format("【任务监控】ID【{0}】任务修改记录的完成稿【{1}】创建失败", projectID, modfItem));
                 ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "alert('设置失败!');", true);
                 return;
             }
         }
         else
         {
             ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "alert('设置失败!修改完成稿已存在。');", true);
             return;
         }
     }
 }