protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Daiv_OA.Entity.TaskEntity taskEntity = new Daiv_OA.BLL.TaskBLL().GetEntity(Str2Int(q("id"))); taskEntity.Content = txt.Text; taskEntity.Nowtime = Convert.ToDateTime(this.txtBegintime.Text); taskEntity.Plantime = Convert.ToDateTime(this.txtEndtime.Text); taskEntity.Worktime = Convert.ToDateTime(this.txtEndtime.Text); taskEntity.Tasktitle = this.txtTitle.Text; taskEntity.Ttype = "未锁定"; taskEntity.Uid = Convert.ToInt32(this.ddlWorker.SelectedValue); taskEntity.Sumtime = Daiv_OA.BLL.TaskBLL.timespans(taskEntity.Nowtime, taskEntity.Plantime); taskEntity.Progresstime = 0; taskEntity.Classse = this.classse.SelectedValue; taskEntity.Question = questext.Text; taskEntity.Tlid = Str2Int(q("id")); if (taskEntity.Nowtime > taskEntity.Plantime) { System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('任务发布时间必须小于计划完成时间!');</script>"); } else { new BLL.TaskBLL().Update(taskEntity); FinalMessage("任务修改成功", "Task_List.aspx", 0); } //查看任务详情,工作信息表的更新 }
//判断是否是发布任务的本人 void MyValidate() { Daiv_OA.Entity.TaskEntity taskEntity = new Daiv_OA.Entity.TaskEntity(); taskEntity = new Daiv_OA.BLL.TaskBLL().GetEntity(Str2Int(q("id"))); if (UserName != taskEntity.Manager) { FinalMessage("该任务你无权修改", "", 1); } }
/// <summary> /// 分页 /// </summary> public void Selectinfo(string str) { int count; BLL.TaskBLL bll = new Daiv_OA.BLL.TaskBLL(); this.Repeater_Work.DataSource = bll.getpage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, out count, str); this.Repeater_Work.DataBind(); AspNetPager1.RecordCount = count; }
void Msgbind() { int id = Str2Int(q("id"), 0); Entity.TaskEntity model = new Entity.TaskEntity(); model = new Daiv_OA.BLL.TaskBLL().GetEntity(id); this.lblTitle.Text = model.Tasktitle; this.lblBegintime.Text = model.Nowtime.ToString(); this.lblEndtime.Text = model.Plantime.ToString(); txt.Text = model.Content; question.Text = model.Question; classse.Text = model.Classse; Manager.Text = model.Manager; labwork.Text = model.Worktime.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string sid = com.getsid("id"); Daiv_OA.BLL.TaskBLL s = new Daiv_OA.BLL.TaskBLL(); if (sid != "-1") { DataTable dt = s.GetList("Tlid=" + sid).Tables[0]; if (dt.Rows.Count != 0) { Workprogress.SelectedValue = dt.Rows[0]["Workprogress"].ToString(); titlename.Text = dt.Rows[0]["remark"].ToString(); } } } }
public string download() { string str = ""; int id = Str2Int(q("id"), 0); Entity.TaskEntity model = new Entity.TaskEntity(); model = new Daiv_OA.BLL.TaskBLL().GetEntity(id); if (model.Filepath != null) { string[] rows = model.Filepath.ToString().Split(",".ToCharArray()); if (rows.Length > 1) { for (int i = 0; i < rows.Length - 1; i++) { str += "<a href=\"/workfile/" + rows[i].ToString() + "\" style=\"border:0\">" + rows[i].Substring(rows[i].LastIndexOf("$") + 1) + "</a><br /> "; } } } return(str); }
//checkboxlist的绑定 void ddlWorkerbind() { this.txtBegintime.Text = DateTime.Now.ToString(); Daiv_OA.BLL.UserBLL user = new Daiv_OA.BLL.UserBLL(); DataTable table = user.GetList(wherestr2).Tables[0]; for (int i = 0; i < table.Rows.Count; i++) { ListItem item = new ListItem(); item.Value = table.Rows[i]["Uid"].ToString(); DataSet ds = new Daiv_OA.BLL.TaskBLL().GetList(" uid = " + Convert.ToInt32(table.Rows[i]["Uid"].ToString()) + " and worktime > '" + Convert.ToDateTime(this.txtBegintime.Text) + "' and [Workprogress]in(2,5,6,7,8)"); if (ds.Tables[0].Rows.Count != 0) { item.Text = table.Rows[i]["Uname"].ToString() + "<font style=\"color:#FF0000\">(" + ds.Tables[0].Rows.Count + ")</font>"; } else { item.Text = table.Rows[i]["Uname"].ToString(); } ddlWorker.Items.Add(item); } }
//保存设置 protected void Button1_Click(object sender, EventArgs e) { if (txtid.Text.Trim() != "") { int id = Convert.ToInt32(txtid.Text.Trim()); Daiv_OA.Entity.TaskEntity taskEntity = new Daiv_OA.BLL.TaskBLL().GetEntity(id); taskEntity.Nowtime = Convert.ToDateTime(this.txtBegintime.Text); taskEntity.Plantime = Convert.ToDateTime(this.txtEndtime.Text); taskEntity.Worktime = Convert.ToDateTime(this.txtEndtime.Text); taskEntity.Sumtime = Daiv_OA.BLL.TaskBLL.timespans(taskEntity.Nowtime, taskEntity.Plantime); taskEntity.Tlid = id; int uid = taskEntity.Uid; taskEntity.Workprogress = Convert.ToInt32(Workprogress.SelectedValue.ToString()); if (taskEntity.Nowtime > taskEntity.Plantime) { Tools.Common.JavaScript.MessageBox(this, "任务发布时间必须小于计划完成时间!"); } else { new BLL.TaskBLL().Update(taskEntity); string name = new Daiv_OA.UI.BasicPage().getvalue(2); if (Workprogress.SelectedValue.ToString() == "3")//验收此任务已完成 { Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(6, "," + uid + ",", "验收结果", name + "验收结果显示您的任务已完成", "My_Work_Show.aspx?id=" + id); } else if (Workprogress.SelectedValue.ToString() == "4")//未及时完成 { Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(6, "," + uid + ",", "验收结果", name + "验收结果显示您的任务未完成", "My_Work_Show.aspx?id=" + id); } else { Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(8, "," + uid + ",", "验收结果", name + "已经重新安排了任务新时间", "My_Work_Show.aspx?id=" + id); } FinalMessage("任务验收执行成功", "TastCheck.aspx?tast=45678", 0); } } }
void Msgbind() { int id = Str2Int(q("id"), 0); Entity.TaskEntity model = new Entity.TaskEntity(); model = new Daiv_OA.BLL.TaskBLL().GetEntity(id); if (model.Workprogress == 1) { Daiv_OA.BLL.TaskBLL u = new Daiv_OA.BLL.TaskBLL(); u.Upworkprogress(2, id); } if (model.Uid != UserId) { FinalMessage("请勿违规操作", "", 100); } this.lblTitle.Text = model.Tasktitle; this.lblBegintime.Text = model.Nowtime.ToString(); this.lblEndtime.Text = model.Plantime.ToString(); txt.Text = model.Content; question.Text = model.Question; classse.Text = model.Classse; Manager.Text = model.Manager; labwork.Text = model.Worktime.ToString(); }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbDel_Click(object sender, CommandEventArgs e) { User_Load("task-del"); Daiv_OA.Entity.TaskEntity taskEntity = new Daiv_OA.Entity.TaskEntity(); taskEntity = new Daiv_OA.BLL.TaskBLL().GetEntity(Convert.ToInt32(e.CommandArgument)); if (UserName == taskEntity.Manager) { if (taskEntity.Ttype == "锁定") { System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('该任务已锁定!');</script>"); } else { new Daiv_OA.BLL.TaskBLL().Delete(Convert.ToInt32(e.CommandArgument)); Selectinfo(wherestr); } } else { System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('该任务你无权修改!');</script>"); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Daiv_OA.Entity.TaskEntity taskEntity = new Daiv_OA.Entity.TaskEntity(); if (this.ddlWorker.SelectedValue.ToString() != "") { DateTime begin = Convert.ToDateTime(this.txtBegintime.Text); DateTime end = Convert.ToDateTime(this.txtEndtime.Text); if (begin < end) { //可以添加 taskEntity.Content = txt.Text.Trim(); taskEntity.Manager = UserName; taskEntity.Nowtime = Convert.ToDateTime(this.txtBegintime.Text); taskEntity.Plantime = Convert.ToDateTime(this.txtEndtime.Text); taskEntity.Tasktitle = this.txtTitle.Text; taskEntity.Worktime = Convert.ToDateTime(this.txtEndtime.Text); taskEntity.Workprogress = 1; taskEntity.Ttype = "未锁定"; taskEntity.Sumtime = Daiv_OA.BLL.TaskBLL.timespans(taskEntity.Nowtime, taskEntity.Plantime); taskEntity.Progresstime = 0; taskEntity.Classse = classse.SelectedValue.ToString(); DataTable dt = sql.Select(Convert.ToInt32(getvalue(1)), 0); foreach (DataRow dr in dt.Rows) { taskEntity.Filepath += dr["names"] + ","; } taskEntity.Question = questext.Text; int i = 0; for (int c = 0; c < ddlWorker.Items.Count; c++) { if (ddlWorker.Items[c].Selected) { taskEntity.Uid = Convert.ToInt32(ddlWorker.Items[c].Value.ToString()); string ToUid = "," + taskEntity.Uid + ","; i = new Daiv_OA.BLL.TaskBLL().Add(taskEntity); Daiv_OA.BLL.OA_SysMessageIn.ADDsysMessage(4, ToUid, "新的工作任务" + taskEntity.Tasktitle, Daiv_OA.Utils.Strings.Left(Daiv_OA.Utils.Strings.delhtml(txt.Text.ToString()), 53), "My_Work_Show.aspx?id=" + i.ToString()); } } if (i > 0) { // Daiv_OA.Utils.QQRobotHelp.SendClusterMessage(); sql.Up(Convert.ToInt32(getvalue(1)), i); FinalMessage("任务添加成功", "Task_List.aspx", 0); } else { FinalMessage("任务添加失败", "Task_List.aspx", 0); } } else { System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('任务开始时间必须大于计划结束时间!');</script>"); } } else { System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('请选择员工!');</script>"); } }