public async Task <IActionResult> PostUserMission([FromBody] UserMission userMission)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.UserMissions.Add(userMission);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (UserMissionExists(userMission.MissionId))
                {
                    return(new StatusCodeResult(StatusCodes.Status409Conflict));
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetUserMission", new { id = userMission.MissionId }, userMission));
        }
        public async Task <IActionResult> PutUserMission([FromRoute] int id, [FromBody] UserMission userMission)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != userMission.MissionId)
            {
                return(BadRequest());
            }

            _context.Entry(userMission).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserMissionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #3
0
        /// <summary>
        /// 添加任务
        /// </summary>
        /// <param name="mission"></param> 任务
        /// <param name="user"></param> 发布人
        /// <returns></returns>
        public async Task AddAsync(Mission mission, User user)
        {
            using (var client = new HttpClient())
            {
                var json = JsonConvert.SerializeObject(mission);
                await client.PostAsync(ServiceEndpoint,
                                       new StringContent(json, Encoding.UTF8, "application/json"));

                var latestCreatedMissionJson =
                    await client.GetStringAsync(MissionServiceEndpoint + "?missionname=" +
                                                mission.MissionName);

                var latestCreatedMission = JsonConvert.DeserializeObject <Mission[]>(latestCreatedMissionJson);

                var usermission = new UserMission
                {
                    UserId    = user.Id,
                    MissionId = latestCreatedMission.Last().MissionId
                };
                var umjson = JsonConvert.SerializeObject(usermission);


                await client.PostAsync(UMServiceEndpoint,
                                       new StringContent(umjson, Encoding.UTF8, "application/json"));

                user.Points -= mission.Points;
                var userjson = JsonConvert.SerializeObject(user);
                await client.PutAsync(UserServiceEndpoint + "/" + user.Id,
                                      new StringContent(userjson, Encoding.UTF8,
                                                        "application/json"));
            }
        }
        /// <summary>
        /// 导出到Word中
        /// </summary>
        public void ExportToDoc()
        {
            NetUserMission uMission = new NetUserMission();
            UserMission    uinfo    = new UserMission();

            DataTable     dt    = uMission.GetMissionDataSet("2", beginSearchDate, endSearchDate, KeyWord).Tables[0];
            StringBuilder sbXml = new StringBuilder();
            string        title = string.Empty;

            if (this.beginTime.Value == this.endTime.Value)
            {
                title = this.beginTime.Value + "工作任务列表";
            }
            else
            {
                title = "从" + this.beginTime.Value + "到" + this.endTime.Value + "的修改完成的列表";
            }
            sbXml.Append(title + "\t\t\t\t\n\n\n");
            sbXml.Append("编号\t\t\t\t任务内容\n\n");
            foreach (DataRow row in dt.Rows)
            {
                sbXml.Append(string.Format("{0}", "1"));

                sbXml.Append(string.Format("\t\t\t\t{0}\n\n", row["MissionDesc"]));
            }
            ExportData.ExportWebData("Word", title, sbXml);
        }
        private const string Parm_EndDate = "@EndDate";           //搜索结束时间

        #endregion

        #region 操作方法

        /// <summary>
        /// 添加用户任务信息
        /// </summary>
        /// <param name="info">传入UserMission对象</param>
        /// <returns></returns>
        public bool Insert(UserMission info)
        {
            bool _Result = true;

            try
            {
                OleDbParameter[] parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_UserId, OleDbType.Integer),
                    new OleDbParameter(Parm_MissionTitle, OleDbType.VarChar, 200),
                    new OleDbParameter(Parm_MissionDesc, OleDbType.LongVarWChar),
                    new OleDbParameter(Parm_WriteDate, OleDbType.Date),
                    new OleDbParameter(Parm_ExecStatus, OleDbType.VarChar, 50),
                    new OleDbParameter(Parm_MissionType, OleDbType.VarChar),
                    new OleDbParameter(Parm_FilePath, OleDbType.VarChar),
                    new OleDbParameter(Parm_WorkHour, OleDbType.Integer)
                };
                parms[0].Value = info.UserID;
                parms[1].Value = info.MissionTitle;
                parms[2].Value = info.MissionDesc;
                parms[3].Value = info.WriteDate;
                parms[4].Value = info.ExecStatus;
                parms[5].Value = info.MissionType;
                parms[6].Value = info.FilePath;
                parms[7].Value = info.WorkHour;
                //parms[8].Value = string.Empty;

                AccessHelper.ExecuteNonQuery(AccessHelper.CONN_STRING, CommandType.Text, SQL_Insert_Mission, parms);
            }
            catch (Exception ex)
            {
                _Result = false;
            }

            return(_Result);
        }
        /// <summary>
        /// 添加任务
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="uname"></param>
        /// <returns></returns>
        public string AddMission(int uid, string desc, int workHour, string type, string path)
        {
            string         tempstr     = string.Empty;
            NetUserMission MissionBLL  = new NetUserMission();
            UserMission    MissionInfo = new UserMission();



            MissionInfo.UserID       = uid;
            MissionInfo.MissionDesc  = desc;
            MissionInfo.WorkHour     = workHour;
            MissionInfo.WriteDate    = System.DateTime.Now;
            MissionInfo.MissionTitle = "";
            MissionInfo.ExecStatus   = "0";
            MissionInfo.MissionType  = type;
            MissionInfo.FilePath     = path;

            if (MissionBLL.Insert(MissionInfo))
            {
                tempstr = "1";
            }
            else
            {
                tempstr = "0";
            }
            return(tempstr);
        }
 public bool IsShowApplyMissionButton(Mission mission, UserMission userMission)
 {
     if (userMission != null) //已经申请过了
     {
         return(false);
     }
     return(MissionBO.Instance.CanApplyMission(User.Current, mission));
 }
        public int GetUserMissionFinishPercent(UserMission userMission)
        {
            if (userMission == null)
            {
                return(0);
            }

            return((int)(userMission.FinishPercent * 100));
        }
        private bool IsShowGetMissionPrizeButton(MissionStatus missionStatus, UserMission userMission)
        {
            if (missionStatus == MissionStatus.Underway && userMission.FinishPercent == 1 && userMission.Mission.Prize.PrizeTypes.Count > 0)
            {
                return(true);
            }

            return(false);
        }
Exemple #10
0
        private UserMission ConvertToUserMission(Mission missionDomain, User user)
        {
            if (missionDomain == null)
            {
                return(null);
            }

            var mission = new UserMission();

            missionDomain.CopyTo(mission);

            var missionHints = new List <UserMissionHint>();

            if (missionDomain.Hints != null)
            {
                foreach (var hint in missionDomain.Hints)
                {
                    var isPayed = user.BoughtHintIds.AnyValues(t => t == hint.Id);
                    missionHints.Add(new UserMissionHint
                    {
                        Id      = hint.Id,
                        Score   = hint.Score,
                        Type    = hint.Type,
                        Text    = isPayed ? hint.Text : string.Empty,
                        IsPayed = isPayed
                    });
                }
            }
            mission.Hints = missionHints;

            if (missionDomain.ExecutionType != ExecutionType.Path)
            {
                return(mission);
            }

            var paramsCount = missionDomain.CalculationFunctionParameters.Count;
            var sb          = new StringBuilder("function(");

            for (var i = 1; i <= paramsCount; i++)
            {
                if (i != 1)
                {
                    sb.Append(",");
                }

                sb.Append($"param{i}");
            }
            sb.Append("){");
            sb.AppendLine(missionDomain.UserCoordinatesCalculationFunction);
            sb.AppendLine("}");
            mission.CoordinatesCalculationFunction = sb.ToString();
            mission.CalculationFunctionParameters  =
                missionDomain.CalculationFunctionParameters.Select(c => c.Substring(2).ToCamelCase());
            return(mission);
        }
 public bool IsShowAbandonMissionButton(UserMission userMission)
 {
     if (userMission == null)
     {
         return(true);
     }
     if (userMission.Status == MissionStatus.Underway && userMission.FinishPercent != 1)
     {
         return(true);
     }
     return(false);
 }
 public bool IsShowReApplyMissionButton(UserMission userMission)
 {
     if (userMission == null)
     {
         return(false);
     }
     if (userMission.Status == MissionStatus.Abandon)
     {
         return(true);
     }
     return(false);
 }
        public bool IsShowGetMissionPrizeButton(UserMission userMission)
        {
            if (userMission == null)
            {
                return(false);
            }
            if (userMission.FinishPercent == 1 && userMission.IsPrized == false && userMission.Mission.Prize.PrizeTypes.Count > 0)
            {
                return(true);
            }

            return(false);
        }
        public bool IsShowGetMissionPrizeButton(string status, UserMission userMission)
        {
            MissionStatus missionStatus;

            try
            {
                missionStatus = (MissionStatus)Enum.Parse(typeof(MissionStatus), status, true);
            }
            catch
            {
                missionStatus = MissionStatus.Underway;
            }
            return(IsShowGetMissionPrizeButton(missionStatus, userMission));
        }
Exemple #15
0
        /// <summary>
        /// 获取数据信息
        /// </summary>
        /// <param name="jid"></param>
        public void GetData(string mid)
        {
            NetUserMission uMission = new NetUserMission();
            UserMission    uInfo    = new UserMission();

            uInfo = uMission.GetNetMissionInfo(mid);
            if (uInfo != null)
            {
                this.txt_EvalDesc.Value       = commonFun.EnReplaceStr(uInfo.MissionDesc);
                this.drop_type.SelectedValue  = uInfo.MissionType;
                this.TextBox_workHour.Text    = uInfo.WorkHour.ToString();
                this.TextBox_realProcess.Text = uInfo.RealProcess.Trim();
            }
        }
 public bool IsShowMissionProcedures(Mission mission, UserMission userMission)
 {
     if (!mission.MissionBase.HaveStepDescriptions)
     {
         return(false);
     }
     if (userMission == null)
     {
         return(true);
     }
     if (userMission.Status == MissionStatus.Underway)
     {
         return(true);
     }
     return(false);
 }
        public void GetMissionDetail(string mid)
        {
            NetUserMission uMission = new NetUserMission();
            UserMission    uinfo    = new UserMission();

            uinfo = uMission.GetNetMissionInfo(mid);
            if (uinfo != null)
            {
                this.div_desc.InnerHtml           = uinfo.MissionDesc;
                this.radio_UserList.SelectedValue = uinfo.UserID.ToString();
                hidSelectUser.Value = uinfo.UserID.ToString();
            }
            else
            {
                this.radio_UserList.SelectedValue = "0";
            }
        }
        /// <summary>
        /// 获取用户的单个日志信息
        /// </summary>
        /// <param name="teachId"></param>
        /// <returns></returns>
        public UserMission GetNetMissionInfo(string mid)
        {
            UserMission info = null;

            try
            {
                OleDbParameter[] parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_MissionId, OleDbType.VarChar, 50)
                };
                parms[0].Value = mid;
                using (OleDbDataReader sdr = AccessHelper.ExecuteReader(AccessHelper.CONN_STRING, CommandType.Text, SQL_Select_MissionDetail, parms))
                {
                    while (sdr.Read())
                    {
                        info             = new UserMission();
                        info.MissionID   = int.Parse(sdr["MissionId"].ToString());
                        info.UserID      = int.Parse(sdr["userid"].ToString());
                        info.MissionDesc = commonFun.replaceStr(sdr["MissionDesc"].ToString());
                        info.MissionType = sdr["MissionType"].ToString();
                        info.FilePath    = sdr["FilePath"].ToString();

                        if (sdr["WorkHour"] == null || sdr["WorkHour"].ToString() == string.Empty)
                        {
                            info.WorkHour = 0;
                        }
                        else
                        {
                            info.WorkHour = int.Parse(sdr["WorkHour"].ToString());
                        }

                        string _realProcess = sdr["RealProcess"].ToString();
                        if (_realProcess != string.Empty)
                        {
                            _realProcess = _realProcess.Replace("%", "");
                        }
                        info.RealProcess = _realProcess;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(info);
        }
        public bool IsShowAbandonMissionButton(string status, UserMission userMission)
        {
            MissionStatus missionStatus;

            try
            {
                missionStatus = (MissionStatus)Enum.Parse(typeof(MissionStatus), status, true);
            }
            catch
            {
                missionStatus = MissionStatus.Underway;
            }
            if (missionStatus == MissionStatus.Underway && userMission.FinishPercent < 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public void UserMission(string missionID, UserMissionTemplate3 template)
        {
            int id;

            if (!int.TryParse(missionID, out id))
            {
                //TODO:
            }
            UserMission userMission = MissionBO.Instance.GetUserMission(UserBO.Instance.GetCurrentUserID(), id);

            bool isApplied, isFinished, havePrize;

            if (userMission == null)
            {
                isApplied  = false;
                isFinished = false;
            }
            else
            {
                isApplied = true;
                if (userMission.FinishPercent == 1)
                {
                    isFinished = true;
                }
                else
                {
                    isFinished = false;
                }
            }

            if (MissionBO.Instance.GetMission(id).Prize.PrizeTypes.Count > 0)
            {
                havePrize = true;
            }
            else
            {
                havePrize = false;
            }
            template(isApplied, isFinished, havePrize, userMission);
        }
        public void UserMission(int missionID, UserMissionTemplate2 template)
        {
            UserMission userMission = MissionBO.Instance.GetUserMission(UserBO.Instance.GetCurrentUserID(), missionID);

            bool isApplied, isFinished, havePrize;

            if (userMission == null)
            {
                isApplied  = false;
                isFinished = false;
            }
            else
            {
                isApplied = true;
                if (userMission.FinishPercent == 1)
                {
                    isFinished = true;
                }
                else
                {
                    isFinished = false;
                }
            }

            if (MissionBO.Instance.GetMission(missionID).Prize.PrizeTypes.Count > 0)
            {
                havePrize = true;
            }
            else
            {
                havePrize = false;
            }

            UserMissionParams userMissionParams = new UserMissionParams(userMission);

            template(userMissionParams, isApplied, isFinished, havePrize);
        }
        private bool IsShowGetMissionPrizeButton(MissionStatus missionStatus, UserMission userMission)
        {
            if (missionStatus == MissionStatus.Underway && userMission.FinishPercent == 1 && userMission.Mission.Prize.PrizeTypes.Count > 0)
                return true;

            return false;
        }
 public bool IsShowApplyMissionButton(Mission mission, UserMission userMission)
 {
     if (userMission != null) //已经申请过了
         return false;
     return MissionBO.Instance.CanApplyMission(User.Current, mission);
 }
 public bool IsShowApplyMissionAgainButton(Mission mission, UserMission userMission)
 {
     return(MissionBO.Instance.CanApplyMissionAgain(User.Current, mission, userMission));
 }
 public bool IsShowAbandonMissionButton(UserMission userMission)
 {
     if (userMission == null)
         return true;
     if (userMission.Status == MissionStatus.Underway && userMission.FinishPercent != 1)
         return true;
     return false;
 }
 public bool IsShowAbandonMissionButton(string status, UserMission userMission)
 {
     MissionStatus missionStatus;
     try
     {
         missionStatus = (MissionStatus)Enum.Parse(typeof(MissionStatus), status, true);
     }
     catch
     {
         missionStatus = MissionStatus.Underway;
     }
     if (missionStatus == MissionStatus.Underway && userMission.FinishPercent < 1)
         return true;
     else
         return false;
 }
 public bool IsShowReApplyMissionButton(UserMission userMission)
 {
     if (userMission == null)
         return false;
     if (userMission.Status == MissionStatus.Abandon)
         return true;
     return false;
 }
 public bool IsShowGetMissionPrizeButton(string status, UserMission userMission)
 {
     MissionStatus missionStatus;
     try
     {
         missionStatus = (MissionStatus)Enum.Parse(typeof(MissionStatus), status, true);
     }
     catch
     {
         missionStatus = MissionStatus.Underway;
     }
     return IsShowGetMissionPrizeButton(missionStatus, userMission);
 }
        public int GetUserMissionFinishPercent(UserMission userMission)
        {
            if (userMission == null)
                return 0;

            return (int)(userMission.FinishPercent * 100);
        }
        /// <summary>
        /// 获取数据集合
        /// </summary>
        /// <param name="IsSearch"></param>
        public void GetMissionList(bool IsSearch)
        {
            NetUserMission misBll  = new NetUserMission();
            UserMission    misInfo = new UserMission();


            #region 分页处理

            if (this.beginTime.Value.Trim() == "" || this.endTime.Value.Trim() == "")
            {
                this.endTime.Value   = System.DateTime.Now.ToString("yyyy-MM-dd");
                this.beginTime.Value = System.DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd");
                beginSearchDate      = this.beginTime.Value;
                endSearchDate        = this.endTime.Value;
            }

            if (IsSearch)
            {
                beginSearchDate = Convert.ToDateTime(this.beginTime.Value).ToString("yyyy-MM-dd");
                endSearchDate   = Convert.ToDateTime(this.endTime.Value).ToString("yyyy-MM-dd");
                Status          = this.drop_Status.SelectedValue;
                UserId          = this.drop_UserList.SelectedValue;
                if (chk_IsAsigin.Checked)
                {
                    IsAsign = "1";
                }
                else
                {
                    IsAsign = "0";
                }
                //IsAsign = this.drop_IsAssign.SelectedValue;
                KeyWord     = this.txt_content.Value.Trim();
                TypeMission = this.drop_type.SelectedValue;
            }
            else
            {
                if (Request.QueryString["bd"] != null && Request.QueryString["ed"] != null)
                {
                    try
                    {
                        beginSearchDate = Convert.ToDateTime(Request.QueryString["bd"]).ToString("yyyy-MM-dd");
                        endSearchDate   = Convert.ToDateTime(Request.QueryString["ed"]).ToString("yyyy-MM-dd");
                    }
                    catch
                    {
                        beginSearchDate = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
                        endSearchDate   = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
                    }
                }
                else
                {
                    beginSearchDate = Convert.ToDateTime(this.beginTime.Value).ToString("yyyy-MM-dd");
                    endSearchDate   = Convert.ToDateTime(this.endTime.Value).ToString("yyyy-MM-dd");
                }
            }

            this.beginTime.Value = beginSearchDate;
            this.endTime.Value   = endSearchDate;

            int userCount   = misBll.GetMissionFYCount(UserId, Status, beginSearchDate, endSearchDate, IsAsign, true, KeyWord, TypeMission);//获取分页总数
            int currentPage = 1;
            try
            {
                currentPage = Convert.ToInt32(Request.QueryString["page"]);
                if (currentPage > (userCount + PageSize - 1) / PageSize)
                {
                    currentPage = (userCount + PageSize - 1) / PageSize;
                }

                if (currentPage <= 0)
                {
                    currentPage = 1;
                }
            }
            catch
            {
                currentPage = 1;
            }
            #endregion

            if (IsAsign == "1")
            {
                tempTitle = "[" + this.drop_UserList.SelectedItem.Text + "]--已经分配的任务列表";
            }
            else
            {
                tempTitle = "[" + this.drop_UserList.SelectedItem.Text + "]--未分配的任务列表";
            }
            this.drop_Status.SelectedValue = Status;
            DataSet ds = misBll.GetMissionDataSet(UserId, Status, beginSearchDate, endSearchDate, PageSize, currentPage, IsAsign, true, KeyWord, TypeMission);

            #region 重新构造数据显示格式
            if (ds == null || ds.Tables.Count == 0)
            {
                //this.Page_Load(null, null);
                HtmlTableRow  hrow  = new HtmlTableRow();
                HtmlTableCell hcell = GetHCell("温馨提示:该时间段没有任务!", false);
                //hcell.Attributes.Add("colspan", "12");

                hrow.Cells.Add(hcell);
                this.tbl_list.Rows.Add(hrow);
            }
            else
            {
                DataTableHelper dHelp = new DataTableHelper();
                DataRow[]       dv    = dHelp.SelectDistinct("result", ds.Tables[0], "userid").Select("1=1");
                if (dv.Length > 0)
                {
                    //创建表头
                    HtmlTableRow hrow = null;
                    hrow = new HtmlTableRow();

                    HtmlTableCell cel19 = GetHCell("人员", true);
                    cel19.Width = "50";
                    hrow.Cells.Add(cel19);

                    //if (Status == "0" || Status == "-1")
                    //{
                    HtmlTableCell cel5 = GetHCell("操作", true);
                    cel5.Width = "40";
                    hrow.Cells.Add(cel5);
                    //}

                    HtmlTableCell cell6 = GetHCell("任务内容", true);
                    //if (Status == "0" || Status == "-1")
                    //{
                    //    cell6.Width = "400";
                    //}
                    //else
                    //{
                    cell6.Width = "690";
                    //}
                    hrow.Cells.Add(cell6);

                    HtmlTableCell cell10 = GetHCell("类型", true);
                    cell10.Width = "70";
                    hrow.Cells.Add(cell10);

                    HtmlTableCell cel7 = GetHCell("<div  title='入库日期'>入库</div>", true);
                    cel7.Width = "40";
                    hrow.Cells.Add(cel7);
                    HtmlTableCell cel17 = GetHCell("<div  title='计划完成任务所需工时'>工时</div>", true);
                    cel17.Width = "40";
                    hrow.Cells.Add(cel17);
                    HtmlTableCell cel2 = GetHCell("<div  title='任务开始执行的时间'>执行</div>", true);
                    cel2.Width = "40";
                    hrow.Cells.Add(cel2);

                    HtmlTableCell cel27 = GetHCell("<div  title='实际完成的任务进度'>实际</div>", true);
                    cel27.Width = "50";
                    hrow.Cells.Add(cel27);
                    HtmlTableCell cel3 = GetHCell("<div  title='此刻计划应该完成的任务进度'>计划</div>", true);
                    cel3.Width = "50";
                    hrow.Cells.Add(cel3);
                    HtmlTableCell cel4 = GetHCell("<div  title='计划完成任务的时间'>计划</div>", true);
                    cel4.Width = "40";
                    hrow.Cells.Add(cel4);
                    HtmlTableCell cel8 = GetHCell("<div  title='实际完成任务的时间'>实际</div>", true);
                    cel8.Width = "40";
                    hrow.Cells.Add(cel8);

                    HtmlTableCell cel60 = GetHCell("状态", true);
                    cel60.Width = "30";
                    hrow.Cells.Add(cel60);

                    tbl_list.Rows.Add(hrow);


                    foreach (DataRow dr in dv)
                    {
                        DataTable dt      = dHelp.GetNewDataTable(ds.Tables[0], "userid=" + dr[0].ToString());
                        int       dtCount = dt.Rows.Count;
                        if (dtCount > 0)
                        {
                            int uCount = dt.Rows.Count;
                            if (uCount > 0)
                            {
                                for (int i = 0; i < uCount; i++)
                                {
                                    string tempBH        = (currentPage - 1) * PageSize + i + 1 + dr[0].ToString();
                                    string tempStatus    = string.Empty;//是否执行
                                    string tempStatusStr = string.Empty;
                                    hrow = new HtmlTableRow();
                                    //string realname = dt.Rows[i]["realName"].ToString();
                                    //if (string.IsNullOrEmpty(realname))
                                    //{
                                    //realname = "<font color=red>未分配</font>";
                                    //}
                                    //hrow.Cells.Add(GetHCell("" + realname + "", false));
                                    string personName = dt.Rows[i]["realName"].ToString();
                                    hrow.Cells.Add(GetHCell(personName, false));
                                    tempStatus = dt.Rows[i]["ExecStatus"].ToString();

                                    if (tempStatus == "0")
                                    {
                                        //if (IsAsign == "0")
                                        //{
                                        //    hrow.Cells.Add(GetHCell("<div><img onclick=\"deldata('" + dt.Rows[i]["MissionId"].ToString() + "','" + dt.Rows[i]["UserId"].ToString() + "')\" style='cursor:pointer;' alt='删除当前任务' src='../inc/images/album_del.gif' border='0'>&nbsp;<img alt='分配当前任务' style='cursor:pointer;' onclick=\"showDiv('" + dt.Rows[i]["MissionId"].ToString() + "')\" src='../inc/images/a_edit.gif' border='0'><img alt='修改当前任务' style='cursor:pointer;' onclick=\"showMission('" + dt.Rows[i]["MissionId"].ToString() + "','" + tempBH + "')\" src='../inc/images/iedit1.gif' border='0'></div>", false));
                                        //}
                                        //else
                                        //{
                                        hrow.Cells.Add(GetHCell("<div><img onclick=\"deldata('" + dt.Rows[i]["MissionId"].ToString() + "','" + dt.Rows[i]["UserId"].ToString() + "','" + dt.Rows[i]["FilePath"].ToString() + "')\" style='cursor:pointer;' alt='删除当前任务' src='../inc/images/album_del.gif' border='0'>&nbsp;<img alt='分配当前任务' style='cursor:pointer;' onclick=\"showDiv('" + dt.Rows[i]["MissionId"].ToString() + "')\" src='../inc/images/a_edit.gif' border='0'>&nbsp;<img alt='修改当前任务' style='cursor:pointer;' onclick=\"showMission('" + dt.Rows[i]["MissionId"].ToString() + "','" + tempBH + "')\" src='../inc/images/iedit1.gif' border='0'></div>", false));
                                        //}
                                    }
                                    else
                                    {
                                        //if (Status == "-1")
                                        //{
                                        if (tempStatus == "1")
                                        {
                                            hrow.Cells.Add(GetHCell("<div><img alt='变更当前任务人' style='cursor:pointer;' onclick=\"showDiv('" + dt.Rows[i]["MissionId"].ToString() + "')\" src='../inc/images/a_edit.gif' border='0'>&nbsp;<img alt='修改当前任务' style='cursor:pointer;' onclick=\"showMission('" + dt.Rows[i]["MissionId"].ToString() + "','" + tempBH + "')\" src='../inc/images/iedit1.gif' border='0'></div>", false));
                                        }
                                        else
                                        {
                                            hrow.Cells.Add(GetHCell("<div>无</div>", false));
                                        }
                                    }

                                    string tempMissAttachment = string.Empty;
                                    if (!string.IsNullOrEmpty(ds.Tables[0].Rows[i]["FilePath"].ToString()))
                                    {
                                        tempMissAttachment = "<span style='padding-left:10px;'><a href='" + dt.Rows[i]["FilePath"].ToString() + "' target='_blank'><img src='/inc/images/download.jpg' border='0'/></a></span>";
                                    }


                                    hrow.Cells.Add(GetHCell("<div style='text-align:left;'><span id='div_mission_" + tempBH + "'>" + commonFun.replaceStr(dt.Rows[i]["MissionDesc"].ToString()) + tempMissAttachment + "</span>&nbsp;<span style='color:red;cursor:pointer;' onclick=\"setTxt('div_mission_" + tempBH + "')\">[复制]</span></div>", false)); //描述

                                    if (tempStatus == "0")
                                    {
                                        tempStatusStr = "<img alt='待执行' src='../inc/images/red.gif' border='0'>";
                                    }
                                    else if (tempStatus == "1")
                                    {
                                        tempStatusStr = "<img alt='执行中' src='../inc/images/yellow.gif' border='0'>";
                                    }
                                    else if (tempStatus == "2")
                                    {
                                        tempStatusStr = "<img alt='已经完成' src='../inc/images/green.gif' border='0'>";
                                    }
                                    string writedate = dt.Rows[i]["WriteDate"].ToString();

                                    string execDate       = dt.Rows[i]["ExecDate"].ToString();
                                    string finishDate     = dt.Rows[i]["FinisthDate"].ToString();
                                    string planFinishDate = dt.Rows[i]["PlanFinishDate"].ToString();
                                    string _workHour      = dt.Rows[i]["WorkHour"].ToString();
                                    // int _realProcess = 0;
                                    // int _planFinishProcess = 0;
                                    // if (dt.Rows[i]["RealProcess"].ToString().Trim() != string.Empty)
                                    // {
                                    //     _realProcess =Convert.ToInt32( dt.Rows[i]["RealProcess"]);
                                    // }

                                    //if (dt.Rows[i]["PlanFinishProcess"].ToString().Trim()!=string.Empty)
                                    //{
                                    //    _planFinishProcess = Convert.ToInt32(dt.Rows[i]["PlanFinishProcess"]);
                                    //}

                                    string _realProcess = dt.Rows[i]["RealProcess"].ToString().Trim();

                                    string _planFinishProcess = dt.Rows[i]["PlanFinishProcess"].ToString().Trim();
                                    // string _realProcess = "30%";
                                    //string _planFinishProcess = "50%";
                                    if (_realProcess != string.Empty && _realProcess != "0")
                                    {
                                        _realProcess = " <div id='div_real1' style='width:50px; height:20px; left: 0px; top: 0px; position:relative; background-color:#EEEEEE;   border-color:#1E6BB2;  border-width:1px; border-style:solid;'> <div id='div_real2' style='width:" + _realProcess + "; height:100%;background:#4AAF4F;color:#0D00EF;text-align:center;  line-height:20px; position:absolute; z-index:-1;left:0px; '></div><div style='position:relative;font-weight:bold; z-index:2; text-align:center;padding-top:3px;'>" + _realProcess + "</div> </div>";
                                    }
                                    else
                                    {
                                        _realProcess = string.Empty;
                                    }

                                    if (_planFinishProcess != string.Empty && _planFinishProcess != "0")
                                    {
                                        _planFinishProcess = " <div id='div_plan1' style='width:50px; height:20px; left: 0px; top: 0px; position:relative; background-color:#EEEEEE;   border-color:#1E6BB2;  border-width:1px; border-style:solid;'><div id='div_plan2' style='width:" + _planFinishProcess + "; height:100%;background:#FF6600;color:#0D00EF;text-align:center; line-height:20px; position:absolute;left:0px; z-index:-1;'></div> <div style='position:relative; font-weight:bold; z-index:2; text-align:center;padding-top:3px;'>" + _planFinishProcess + "</div></div>";
                                    }
                                    else
                                    {
                                        _planFinishProcess = string.Empty;
                                    }

                                    if (!string.IsNullOrEmpty(execDate))
                                    {
                                        execDate = Convert.ToDateTime(execDate).ToString("M-dd H:mm");
                                    }
                                    if (!string.IsNullOrEmpty(finishDate))
                                    {
                                        finishDate = Convert.ToDateTime(finishDate).ToString("M-dd H:mm");
                                    }
                                    if (!string.IsNullOrEmpty(writedate))
                                    {
                                        writedate = Convert.ToDateTime(writedate).ToString("M-dd H:mm");
                                    }
                                    if (!string.IsNullOrEmpty(planFinishDate))
                                    {
                                        planFinishDate = Convert.ToDateTime(planFinishDate).ToString("M-dd H:mm");
                                    }
                                    string _missionType = string.Empty;
                                    if (dt.Rows[i]["MissionType"].ToString() == "0")
                                    {
                                        _missionType = "维护";
                                    }
                                    else if (dt.Rows[i]["MissionType"].ToString() == "1")
                                    {
                                        _missionType = "开发";
                                    }
                                    else if (dt.Rows[i]["MissionType"].ToString() == "2")
                                    {
                                        _missionType = "需求分析";
                                    }
                                    else if (dt.Rows[i]["MissionType"].ToString() == "3")
                                    {
                                        _missionType = "系统设计";
                                    }


                                    //显示数据
                                    hrow.Cells.Add(GetHCell(_missionType, false));       //任务类型
                                    hrow.Cells.Add(GetHCell(writedate, false));          //入库日期
                                    hrow.Cells.Add(GetHCell(_workHour, false));          //计划工时
                                    hrow.Cells.Add(GetHCell(execDate, false));           //执行日期
                                    hrow.Cells.Add(GetHCell(_realProcess, false));       //实际进度
                                    hrow.Cells.Add(GetHCell(_planFinishProcess, false)); //计划工作进度

                                    hrow.Cells.Add(GetHCell(planFinishDate, false));     //计划结束时间
                                    hrow.Cells.Add(GetHCell(finishDate, false));         //结束日期

                                    hrow.Cells.Add(GetHCell(tempStatusStr, false));      //执行状态


                                    tbl_list.Rows.Add(hrow);
                                }
                            }
                            else
                            {
                                hrow = new HtmlTableRow();
                                HtmlTableCell hcell = GetHCell("温馨提示:该时间段没有任何任务!", false);
                                hcell.Attributes.Add("colspan", "12");
                                hrow.Cells.Add(hcell);

                                tbl_list.Rows.Add(hrow);
                            }
                        }
                        else
                        {
                            hrow = new HtmlTableRow();
                            HtmlTableCell hcell = GetHCell("温馨提示:该时间段没有任何任务!", false);
                            hcell.Attributes.Add("colspan", "12");
                            hrow.Cells.Add(hcell);

                            tbl_list.Rows.Add(hrow);
                        }
                    }
                }
                else
                {
                    HtmlTableRow  hrow  = new HtmlTableRow();
                    HtmlTableCell hcell = GetHCell("温馨提示:该时间段没有任何任务!", false);
                    //hcell.Attributes.Add("colspan", "12");
                    hrow.Cells.Add(hcell);

                    tbl_list.Rows.Add(hrow);
                }
            }
            #endregion

            #region 数据显示方式 原来的

            //HtmlTableRow hrow = null;
            //if (ds != null)
            //{

            //    hrow = new HtmlTableRow();

            //    HtmlTableCell cel1 = GetHCell("任务人", true);
            //    cel1.Width = "60";
            //    hrow.Cells.Add(cel1);

            //    HtmlTableCell cell6 = GetHCell("任务内容", true);
            //    if (Status == "0" || Status == "-1")
            //    {
            //        cell6.Width = "560";
            //    }
            //    else
            //    {
            //        cell6.Width = "600";
            //    }
            //    hrow.Cells.Add(cell6);

            //    HtmlTableCell cel7 = GetHCell("入库日期", true);
            //    cel7.Width = "70";
            //    hrow.Cells.Add(cel7);

            //    HtmlTableCell cel2 = GetHCell("执行时间", true);
            //    cel2.Width = "70";
            //    hrow.Cells.Add(cel2);

            //    HtmlTableCell cel3 = GetHCell("结束日期", true);
            //    cel3.Width = "70";
            //    hrow.Cells.Add(cel3);



            //    HtmlTableCell cel4 = GetHCell("状态", true);
            //    cel4.Width = "40";
            //    hrow.Cells.Add(cel4);

            //    if (Status == "0" || Status == "-1")
            //    {
            //        HtmlTableCell cel5 = GetHCell("操作", true);
            //        cel5.Width = "30";
            //        hrow.Cells.Add(cel5);
            //    }

            //    tbl_list.Rows.Add(hrow);

            //    int uCount = ds.Tables[0].Rows.Count;
            //    if (uCount > 0)
            //    {
            //        for (int i = 0; i < uCount; i++)
            //        {

            //            string tempStatus = string.Empty;//是否执行
            //            string tempStatusStr = string.Empty;
            //            hrow = new HtmlTableRow();
            //            string realname = ds.Tables[0].Rows[i]["realName"].ToString();
            //            if (string.IsNullOrEmpty(realname))
            //            {
            //                realname = "<font color=red>未分配</font>";
            //            }
            //            hrow.Cells.Add(GetHCell("" + realname + "", false));
            //            hrow.Cells.Add(GetHCell("<div style='text-align:left;'>" + commonFun.replaceStr(ds.Tables[0].Rows[i]["MissionDesc"].ToString()) + "</div>", false)); //描述
            //            tempStatus = ds.Tables[0].Rows[i]["ExecStatus"].ToString();
            //            if (tempStatus == "0")
            //            {
            //                tempStatusStr = "<img alt='待执行' src='../inc/images/red.gif' border='0'>";
            //            }
            //            else if (tempStatus == "1")
            //            {
            //                tempStatusStr = "<img alt='执行中' src='../inc/images/yellow.gif' border='0'>";
            //            }
            //            else if (tempStatus == "2")
            //            {
            //                tempStatusStr = "<img alt='已经完成' src='../inc/images/green.gif' border='0'>";
            //            }
            //            string writedate = ds.Tables[0].Rows[i]["WriteDate"].ToString();
            //            string execDate=ds.Tables[0].Rows[i]["ExecDate"].ToString();
            //            string finishDate=ds.Tables[0].Rows[i]["FinisthDate"].ToString();

            //            if(!string.IsNullOrEmpty(execDate))
            //            {
            //                execDate=Convert.ToDateTime(execDate).ToString("MM-dd hh:mm");
            //            }
            //            if(!string.IsNullOrEmpty(finishDate))
            //            {
            //                finishDate=Convert.ToDateTime(finishDate).ToString("MM-dd hh:mm");
            //            }
            //            if(!string.IsNullOrEmpty(writedate))
            //            {
            //                writedate=Convert.ToDateTime(writedate).ToString("MM-dd hh:mm");
            //            }
            //            hrow.Cells.Add(GetHCell(writedate, false)); //入库日期
            //            hrow.Cells.Add(GetHCell(execDate, false)); //执行日期
            //            hrow.Cells.Add(GetHCell(finishDate, false)); //结束日期

            //            hrow.Cells.Add(GetHCell(tempStatusStr, false)); //执行状态
            //            if (tempStatus == "0")
            //            {
            //                if (IsAsign == "0")
            //                {
            //                    hrow.Cells.Add(GetHCell("<div><img onclick=\"deldata('" + ds.Tables[0].Rows[i]["MissionId"].ToString() + "','" + ds.Tables[0].Rows[i]["UserId"].ToString() + "')\" style='cursor:pointer;' alt='删除当前任务' src='../inc/images/album_del.gif' border='0'>&nbsp;<img alt='分配当前任务' onclick=\"showDiv('"+ds.Tables[0].Rows[i]["MissionId"].ToString()+"')\" src='../inc/images/a_edit.gif' border='0'></div>", false));
            //                }
            //                else
            //                {
            //                    hrow.Cells.Add(GetHCell("<div><img onclick=\"deldata('" + ds.Tables[0].Rows[i]["MissionId"].ToString() + "','" + ds.Tables[0].Rows[i]["UserId"].ToString() + "')\" style='cursor:pointer;' alt='删除当前任务' src='../inc/images/album_del.gif' border='0'>&nbsp;<img alt='修改当前任务' src='../inc/images/a_edit.gif' border='0'></div>", false));
            //                }
            //            }
            //            else
            //            {
            //                if (Status == "-1")
            //                {
            //                    hrow.Cells.Add(GetHCell("<div>无</div>", false));
            //                }
            //            }

            //            tbl_list.Rows.Add(hrow);
            //        }
            //    }
            //    else
            //    {
            //        hrow = new HtmlTableRow();
            //        HtmlTableCell hcell = null;
            //        if (Status == "0" || Status == "-1")
            //        {
            //            hcell = GetHCell("温馨提示:该时间段没有任何任务!", false);
            //            hcell.Attributes.Add("colspan", "7");
            //            hrow.Cells.Add(hcell);
            //        }
            //        else
            //        {
            //            hcell = GetHCell("温馨提示:该时间段没有任何任务!", false);
            //            hcell.Attributes.Add("colspan", "6");
            //            hrow.Cells.Add(hcell);
            //        }
            //        tbl_list.Rows.Add(hrow);
            //    }
            //}
            //else
            //{
            //    hrow = new HtmlTableRow();
            //    HtmlTableCell hcell = null;
            //    if (Status == "0" || Status == "-1")
            //    {
            //        hcell = GetHCell("温馨提示:该时间段没有任何任务!", false);
            //        hcell.Attributes.Add("colspan", "7");
            //        hrow.Cells.Add(hcell);
            //    }
            //    else
            //    {
            //        hcell = GetHCell("温馨提示:该时间段没有任何任务!", false);
            //        hcell.Attributes.Add("colspan", "6");
            //        hrow.Cells.Add(hcell);
            //    }
            //    tbl_list.Rows.Add(hrow);
            //}

            #endregion

            string parms = "&isa=" + IsAsign + "&opt=off&bd=" + beginSearchDate + "&ed=" + endSearchDate + "&uid=" + UserId + "&st=" + Status + "&tl=" + Server.UrlEncode(KeyWord) + "&to=" + TypeMission;
            GetPage(userCount, PageSize, currentPage, parms);//获取分页文字
        }
 public bool IsShowMissionProcedures(Mission mission, UserMission userMission)
 {
     if (!mission.MissionBase.HaveStepDescriptions)
         return false;
     if (userMission == null)
         return true;
     if (userMission.Status == MissionStatus.Underway)
         return true;
     return false;
 }
        public bool IsShowGetMissionPrizeButton(UserMission userMission)
        {
            if (userMission == null)
                return false;
            if (userMission.FinishPercent == 1 && userMission.IsPrized == false && userMission.Mission.Prize.PrizeTypes.Count > 0)
                return true;

            return false;
        }
 public UserMissionListItemParams(UserMission userMission, MissionStatus currentStatus)
 {
     m_UserMission = userMission;
     m_CurrentStatus = currentStatus;
 }
 public UserMissionParams(UserMission userMission)
 {
     m_UserMission = userMission;
 }
        /// <summary>
        /// 获取数据集合
        /// </summary>
        /// <param name="IsSearch"></param>
        public void GetMissionList(bool IsSearch)
        {
            NetUserMission misBll  = new NetUserMission();
            UserMission    misInfo = new UserMission();

            #region 分页处理

            if (this.beginTime.Value.Trim() == "" || this.endTime.Value.Trim() == "")
            {
                this.endTime.Value   = System.DateTime.Now.ToString("yyyy-MM-dd");
                this.beginTime.Value = System.DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd");
                beginSearchDate      = this.beginTime.Value;
                endSearchDate        = this.endTime.Value;
            }

            if (IsSearch)
            {
                beginSearchDate = Convert.ToDateTime(this.beginTime.Value).ToString("yyyy-MM-dd");
                endSearchDate   = Convert.ToDateTime(this.endTime.Value).ToString("yyyy-MM-dd");
                Status          = this.drop_Status.SelectedValue;
                UserId          = this.drop_UserList.SelectedValue;
                TypeMission     = this.drop_type.SelectedValue;
            }
            else
            {
                if (Request.QueryString["bd"] != null && Request.QueryString["ed"] != null)
                {
                    try
                    {
                        beginSearchDate = Convert.ToDateTime(Request.QueryString["bd"]).ToString("yyyy-MM-dd");
                        endSearchDate   = Convert.ToDateTime(Request.QueryString["ed"]).ToString("yyyy-MM-dd");
                    }
                    catch
                    {
                        beginSearchDate = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
                        endSearchDate   = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
                    }
                }
                else
                {
                    beginSearchDate = Convert.ToDateTime(this.beginTime.Value).ToString("yyyy-MM-dd");
                    endSearchDate   = Convert.ToDateTime(this.endTime.Value).ToString("yyyy-MM-dd");
                }
            }

            this.beginTime.Value = beginSearchDate;
            this.endTime.Value   = endSearchDate;

            int userCount   = misBll.GetMissionFYCount(UserId, Status, beginSearchDate, endSearchDate, "1", false, "", TypeMission);//获取分页总数
            int currentPage = 1;
            try
            {
                currentPage = Convert.ToInt32(Request.QueryString["page"]);
                if (currentPage > (userCount + PageSize - 1) / PageSize)
                {
                    currentPage = (userCount + PageSize - 1) / PageSize;
                }

                if (currentPage <= 0)
                {
                    currentPage = 1;
                }
            }
            catch
            {
                currentPage = 1;
            }
            #endregion
            tempTitle = "[" + this.drop_UserList.SelectedItem.Text + "]--" + this.drop_Status.SelectedItem.Text + "的任务列表";
            this.drop_Status.SelectedValue = Status;

            DataSet      ds   = misBll.GetMissionDataSet(UserId, Status, beginSearchDate, endSearchDate, PageSize, currentPage, "1", false, "", TypeMission);
            HtmlTableRow hrow = null;
            if (ds != null)
            {
                int uCount = ds.Tables[0].Rows.Count;
                if (uCount > 0)
                {
                    if (Session["userid"] != null)
                    {
                        if (Session["userid"].ToString() == UserId && Status == "0")
                        {
                            //如果是用户本人并且显示待执行的任务时

                            hrow = new HtmlTableRow();
                            //HtmlTableCell cel19 = GetHCell("人员", true);
                            //cel19.Width = "50";
                            //hrow.Cells.Add(cel19);

                            HtmlTableCell cell6 = GetHCell("待执行的任务内容", true);
                            cell6.Width = "610";

                            hrow.Cells.Add(cell6);

                            HtmlTableCell cell10 = GetHCell("<div  title='任务类型'>类型</div>", true);
                            cell10.Width = "50";
                            hrow.Cells.Add(cell10);

                            HtmlTableCell cel7 = GetHCell("<div  title='任务入库日期'>入库</div>", true);
                            cel7.Width = "40";
                            hrow.Cells.Add(cel7);
                            HtmlTableCell cel17 = GetHCell("<div  title='计划完成任务所需工时'>工时</div>", true);
                            cel17.Width = "40";
                            hrow.Cells.Add(cel17);

                            HtmlTableCell cel60 = GetHCell("操作", true);
                            cel60.Width = "80";
                            hrow.Cells.Add(cel60);

                            tbl_list.Rows.Add(hrow);


                            for (int i = 0; i < uCount; i++)
                            {
                                DataTable dt = ds.Tables[0];
                                hrow = new HtmlTableRow();
                                //string _personName = dt.Rows[i]["realName"].ToString();
                                string tempBH             = (1 + i).ToString();
                                string tempMissAttachment = string.Empty;
                                if (!string.IsNullOrEmpty(dt.Rows[i]["FilePath"].ToString()))
                                {
                                    tempMissAttachment = "<span style='padding-left:10px;'><a href='" + dt.Rows[i]["FilePath"].ToString() + "' target='_blank'><img src='/inc/images/download.jpg' border='0'/></a></span>";
                                }


                                string _content = "<div style='text-align:left;'><span id='div_mission_" + tempBH + "'>" + commonFun.replaceStr(dt.Rows[i]["MissionDesc"].ToString()) + tempMissAttachment + "</span>&nbsp;<span style='color:red;cursor:pointer;' onclick=\"setTxt('div_mission_" + tempBH + "')\">[复制]</span></div>";
                                //string _content = "<div style='text-align:left;'>" + dt.Rows[i]["MissionDesc"].ToString().Trim() + "</div>";
                                string _missionType = dt.Rows[i]["MissionType"].ToString().Trim();
                                string _workHour    = dt.Rows[i]["WorkHour"].ToString().Trim();
                                string _writedate   = dt.Rows[i]["WriteDate"].ToString().Trim();


                                string _operation = "<input  class=\"btn\" type=\"button\" value=\"开始执行\" onclick=\"doSomething('first','" + ds.Tables[0].Rows[i]["UserId"].ToString() + "','" + ds.Tables[0].Rows[i]["MissionId"].ToString() + "');\" />";



                                if (!string.IsNullOrEmpty(_writedate))
                                {
                                    _writedate = Convert.ToDateTime(_writedate).ToString("M-dd H:mm");
                                }

                                if (_missionType == "0")
                                {
                                    _missionType = "维护";
                                }
                                else if (_missionType == "1")
                                {
                                    _missionType = "开发";
                                }
                                else if (_missionType == "2")
                                {
                                    _missionType = "需求分析";
                                }
                                else if (_missionType == "3")
                                {
                                    _missionType = "系统设计";
                                }
                                string _personName = dt.Rows[i]["realName"].ToString();
                                hrow.Cells.Add(GetHCell(_content, false));     // 任务内容
                                hrow.Cells.Add(GetHCell(_missionType, false)); //任务类型
                                hrow.Cells.Add(GetHCell(_writedate, false));   //入库日期
                                hrow.Cells.Add(GetHCell(_workHour, false));    //计划工时

                                hrow.Cells.Add(GetHCell(_operation, false));   //操作


                                tbl_list.Rows.Add(hrow);
                            }
                        }
                        else
                        {
                            //所有人情况


                            hrow = new HtmlTableRow();
                            HtmlTableCell cel19 = GetHCell("人员", true);
                            cel19.Width = "50";
                            hrow.Cells.Add(cel19);

                            HtmlTableCell cell6 = GetHCell("正在执行的任务内容", true);
                            cell6.Width = "360";

                            hrow.Cells.Add(cell6);

                            HtmlTableCell cell10 = GetHCell("<div  title='任务类型'>类型</div>", true);
                            cell10.Width = "50";
                            hrow.Cells.Add(cell10);

                            HtmlTableCell cel7 = GetHCell("<div  title='任务入库日期'>入库</div>", true);
                            cel7.Width = "40";
                            hrow.Cells.Add(cel7);
                            HtmlTableCell cel17 = GetHCell("<div  title='计划完成任务所需工时'>工时</div>", true);
                            cel17.Width = "40";
                            hrow.Cells.Add(cel17);
                            HtmlTableCell cel2 = GetHCell("<div  title='任务开始执行的时间'>执行</div>", true);
                            cel2.Width = "40";
                            hrow.Cells.Add(cel2);

                            HtmlTableCell cel27 = GetHCell("<div  title='实际完成的任务进度'>实际</div>", true);
                            cel27.Width = "50";
                            hrow.Cells.Add(cel27);
                            HtmlTableCell cel3 = GetHCell("<div  title='计划完成的任务进度'>计划</div>", true);
                            cel3.Width = "50";
                            hrow.Cells.Add(cel3);
                            HtmlTableCell cel4 = GetHCell("<div  title='计划完成任务的时间'>计划</div>", true);
                            cel4.Width = "40";
                            hrow.Cells.Add(cel4);
                            HtmlTableCell cel8 = GetHCell("<div  title='实际完成任务的时间'>实际</div>", true);
                            cel3.Width = "40";
                            hrow.Cells.Add(cel8);

                            //HtmlTableCell cel6 = GetHCell("<div  title='任务目前状态'>状态</div>", true);
                            //cel6.Width = "40";
                            //hrow.Cells.Add(cel6);
                            //HtmlTableCell cel60 = GetHCell("操作", true);
                            //cel60.Width = "40";
                            //hrow.Cells.Add(cel60);

                            tbl_list.Rows.Add(hrow);


                            for (int i = 0; i < uCount; i++)
                            {
                                DataTable dt = ds.Tables[0];



                                hrow = new HtmlTableRow();
                                string _personName = dt.Rows[i]["realName"].ToString();

                                string tempBH             = (1 + i).ToString();
                                string tempMissAttachment = string.Empty;
                                if (!string.IsNullOrEmpty(dt.Rows[i]["FilePath"].ToString()))
                                {
                                    tempMissAttachment = "<span style='padding-left:10px;'><a href='" + dt.Rows[i]["FilePath"].ToString() + "' target='_blank'><img src='/inc/images/download.jpg' border='0'/></a></span>";
                                }


                                string _content = "<div style='text-align:left;'><span id='div_mission_" + tempBH + "'>" + commonFun.replaceStr(dt.Rows[i]["MissionDesc"].ToString()) + tempMissAttachment + "</span>&nbsp;<span style='color:red;cursor:pointer;' onclick=\"setTxt('div_mission_" + tempBH + "')\">[复制]</span></div>";
                                //string _content = "<div style='text-align:left;'>" + dt.Rows[i]["MissionDesc"].ToString().Trim() + "</div>";
                                string _missionType = dt.Rows[i]["MissionType"].ToString().Trim();
                                string _workHour    = dt.Rows[i]["WorkHour"].ToString().Trim();
                                string _writedate   = dt.Rows[i]["WriteDate"].ToString().Trim();

                                string _execDate          = dt.Rows[i]["ExecDate"].ToString().Trim();
                                string _realProcess       = dt.Rows[i]["RealProcess"].ToString().Trim();
                                string _planFinishProcess = dt.Rows[i]["PlanFinishProcess"].ToString().Trim();
                                string _planFinishDate    = dt.Rows[i]["PlanFinishDate"].ToString().Trim();
                                string _finishDate        = dt.Rows[i]["FinisthDate"].ToString();
                                //string _Status = dt.Rows[i]["ExecStatus"].ToString().Trim();

                                // string _realProcess = "30%";
                                //string _planFinishProcess = "50%";

                                //string _operation = "<input class=\"btn\" type=\"button\" value=\"完成\" onclick=\"doSomething('second','" + ds.Tables[0].Rows[i]["UserId"].ToString() + "','" + ds.Tables[0].Rows[i]["MissionId"].ToString() + "');\" />";


                                if (_realProcess != string.Empty && _realProcess != "0")
                                {
                                    _realProcess = " <div id='div_real1' style='width:50px; height:20px; left: 0px; top: 0px; position:relative; background-color:#EEEEEE;   border-color:#1E6BB2;  border-width:1px; border-style:solid;'> <div id='div_real2' style='width:" + _realProcess + "; height:100%;background:#4AAF4F;color:#0D00EF;text-align:center;  line-height:20px; position:absolute; z-index:-1;left:0px; '></div><div style='position:relative;font-weight:bold; z-index:2; text-align:center;padding-top:3px;'>" + _realProcess + "</div> </div>";
                                }
                                else
                                {
                                    _realProcess = string.Empty;
                                }

                                if (_planFinishProcess != string.Empty && _planFinishProcess != "0")
                                {
                                    _planFinishProcess = " <div id='div_plan1' style='width:50px; height:20px; left: 0px; top: 0px; position:relative; background-color:#EEEEEE;   border-color:#1E6BB2;  border-width:1px; border-style:solid;'><div id='div_plan2' style='width:" + _planFinishProcess + "; height:100%;background:#FF6600;color:#0D00EF;text-align:center; line-height:20px; position:absolute;left:0px; z-index:-1;'></div> <div style='position:relative; font-weight:bold; z-index:2; text-align:center;padding-top:3px;'>" + _planFinishProcess + "</div></div>";
                                }
                                else
                                {
                                    _planFinishProcess = string.Empty;
                                }

                                if (!string.IsNullOrEmpty(_execDate))
                                {
                                    _execDate = Convert.ToDateTime(_execDate).ToString("M-dd H:mm");
                                }
                                if (!string.IsNullOrEmpty(_finishDate))
                                {
                                    _finishDate = Convert.ToDateTime(_finishDate).ToString("M-dd H:mm");
                                }
                                if (!string.IsNullOrEmpty(_writedate))
                                {
                                    _writedate = Convert.ToDateTime(_writedate).ToString("M-dd H:mm");
                                }
                                if (!string.IsNullOrEmpty(_planFinishDate))
                                {
                                    _planFinishDate = Convert.ToDateTime(_planFinishDate).ToString("M-dd H:mm");
                                }
                                if (_missionType == "0")
                                {
                                    _missionType = "维护";
                                }
                                else if (_missionType == "1")
                                {
                                    _missionType = "开发";
                                }
                                else if (_missionType == "2")
                                {
                                    _missionType = "需求分析";
                                }
                                else if (_missionType == "3")
                                {
                                    _missionType = "系统设计";
                                }

                                //if (_Status == "0")
                                //{
                                //    _Status = "待执行";
                                //}
                                //else if (_Status == "1")
                                //{
                                //    _Status = "执行中";
                                //}
                                //else if (_Status == "2")
                                //{
                                //    _Status = "已完成";
                                //}
                                hrow.Cells.Add(GetHCell(_personName, false));        //人员姓名
                                hrow.Cells.Add(GetHCell(_content, false));           // 任务内容
                                hrow.Cells.Add(GetHCell(_missionType, false));       //任务类型
                                hrow.Cells.Add(GetHCell(_writedate, false));         //入库日期
                                hrow.Cells.Add(GetHCell(_workHour, false));          //计划工时
                                hrow.Cells.Add(GetHCell(_execDate, false));          //执行日期
                                hrow.Cells.Add(GetHCell(_realProcess, false));       //实际进度
                                hrow.Cells.Add(GetHCell(_planFinishProcess, false)); //计划工作进度

                                hrow.Cells.Add(GetHCell(_planFinishDate, false));    //计划结束时间
                                hrow.Cells.Add(GetHCell(_finishDate, false));        //实际结束时间
                                //hrow.Cells.Add(GetHCell(_Status, false));  //执行状态
                                //hrow.Cells.Add(GetHCell(_operation, false));//操作


                                tbl_list.Rows.Add(hrow);
                            }
                        }
                    }
                    else
                    {
                        Response.Redirect("/login.aspx");
                    }
                }
                else
                {
                    hrow = new HtmlTableRow();
                    string        tempNo = "温馨提示:没有任务信息!";
                    HtmlTableCell cell   = GetHCell(tempNo, false);
                    cell.Height = "35px;";
                    hrow.Cells.Add(cell);
                    tbl_list.Rows.Add(hrow);
                }
            }
            else
            {
            }

            string parms = "&bd=" + beginSearchDate + "&ed=" + endSearchDate + "&uid=" + UserId + "&st=" + Status + "&to=" + TypeMission;
            GetPage(userCount, PageSize, currentPage, parms);//获取分页文字
        }
 public UserMissionListItemParams(UserMission userMission, MissionStatus currentStatus)
 {
     m_UserMission   = userMission;
     m_CurrentStatus = currentStatus;
 }
 public bool IsShowApplyMissionAgainButton(Mission mission, UserMission userMission)
 {
     return MissionBO.Instance.CanApplyMissionAgain(User.Current, mission, userMission);
 }
 public UserMissionParams(UserMission userMission)
 {
     m_UserMission = userMission;
 }