void Up() { DataTable table = com.GetList("uid = " + UserId + " and Workprogress in(2,5,6)").Tables[0]; Daiv_OA.Entity.TaskEntity model = new Daiv_OA.Entity.TaskEntity(); foreach (DataRow dr in table.Rows) { if (Convert.ToInt32(dr["Workprogress"].ToString()) == 2) { DateTime now = Convert.ToDateTime(DateTime.Now.ToString("yyyy-M-d HH:mm:ss")); if (now <= Convert.ToDateTime(dr["Plantime"].ToString())) { int i = Daiv_OA.BLL.TaskBLL.timespans(Convert.ToDateTime(dr["Nowtime"].ToString()), now); model.Progresstime = i; } else { continue; } } else { //提前完成或提交已完成 model.Progresstime = Convert.ToInt32(dr["sumtime"].ToString()); } model.Tlid = Convert.ToInt32(dr["Tlid"].ToString()); model.Worktime = Convert.ToDateTime(dr["Worktime"].ToString()); model.Nowtime = Convert.ToDateTime(dr["Nowtime"].ToString()); model.Plantime = Convert.ToDateTime(dr["Plantime"].ToString()); model.Newnote = dr["newnote"].ToString(); com.Update(model); } }
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(); } } } }