Esempio n. 1
0
 private void Show(string tid)
 {
     this.ti = Tasks.Init().GetById(Convert.ToInt32(tid));
     if (this.Uid == string.Concat(this.ti.CreatorID) || this.ti.ManageUserList.Contains("#" + this.Uid + "#") || this.ti.ExecuteUserList.Contains("#" + this.Uid + "#") || this.Modules.Contains("51"))
     {
         this.DetailShow();
         this.RptShow();
         this.displays.Visible  = false;
         this.exetables.Visible = false;
         this.s1.Visible        = false;
         this.s2.Visible        = false;
         this.b3.Visible        = false;
         if (this.ti.ManageUserList.Contains("#" + this.Uid + "#"))
         {
             this.displays.Visible = true;
             if (this.ti.Status == 1)
             {
                 this.b3.Visible = true;
             }
         }
         if (this.ti.ExecuteUserList.Contains("#" + this.Uid + "#"))
         {
             IList all = Tasks_User.Init().GetAll(string.Concat(new object[]
             {
                 "TaskID=",
                 this.ti.id,
                 " and UserID=",
                 this.Uid
             }), null);
             if (all.Count > 0 && this.ti.Status == 1)
             {
                 Hashtable tasks_UserHash = this.GetTasks_UserHash(all);
                 string    a    = string.Concat(tasks_UserHash["noaccept"]);
                 string    a2   = string.Concat(tasks_UserHash["accept"]);
                 string    text = string.Concat(tasks_UserHash["submit"]);
                 if (a == "1" && a2 == "0" && text == "0")
                 {
                     this.displays.Visible  = true;
                     this.exetables.Visible = false;
                     this.s1.Visible        = false;
                     this.s2.Visible        = true;
                 }
                 if (a2 == "1" && a == "0" && text == "0")
                 {
                     this.displays.Visible  = true;
                     this.exetables.Visible = true;
                     this.s1.Visible        = true;
                     this.s2.Visible        = false;
                 }
                 if (Convert.ToInt32(text) > 0 && a == "0" && a2 == "0" && this.ti.OnceSubmit == 1)
                 {
                     this.displays.Visible  = true;
                     this.exetables.Visible = true;
                     this.s1.Visible        = true;
                     this.s2.Visible        = false;
                 }
             }
         }
     }
 }
Esempio n. 2
0
    private void RptShow()
    {
        IList all = Tasks_User.Init().GetAll("TaskID=" + this.ti.id, "order by WorkTag desc,id desc");

        this.rpt.DataSource = all;
        this.rpt.DataBind();
    }
Esempio n. 3
0
    private void Show(string tid)
    {
        Tasks_UserInfo byId  = Tasks_User.Init().GetById(Convert.ToInt32(tid));
        TasksInfo      byId2 = Tasks.Init().GetById(byId.TaskID);

        if (this.Uid == string.Concat(byId.UserID) || (byId2.IsOtherSee == 1 && byId2.ExecuteUserList.Contains("#" + this.Uid + "#")) || byId2.ManageUserList.Contains("#" + this.Uid + "#") || this.Modules.Contains("51"))
        {
            this.pizhu1s.Visible = false;
            this.pizhu3.Visible  = false;
            if (byId2.ManageUserList.Contains("#" + this.Uid + "#") && byId2.Status == 1)
            {
                this.pizhu1s.Visible = true;
                this.pizhu3.Visible  = true;
            }
            this.TaskUser.InnerText  = byId.RealName + "(" + byId.DepName + ")";
            this.TaskName.InnerText  = byId2.TaskName;
            this.WorkTitle.InnerText = byId.WorkTitle;
            this.AddTime.InnerText   = byId.AddTime;
            byId.WorkNotes           = (byId.WorkNotes ?? "");
            if (byId.WorkNotes.ToLower().Contains("script"))
            {
                this.Notes.InnerHtml = byId.WorkNotes.ToLower().Replace("script", "scrript");
            }
            else
            {
                this.Notes.InnerHtml = byId.WorkNotes;
            }
            if (!string.IsNullOrEmpty(byId.FilePath))
            {
                string[] array = byId.FilePath.Split(new char[]
                {
                    '|'
                });
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].Trim() != "")
                    {
                        int    num = array[i].LastIndexOf('/') + 1;
                        string arg = array[i].Substring(num, array[i].Length - num);
                        string s   = array[i].Replace("~", "");
                        this.fjs += string.Format(this.fj, base.Server.UrlEncode(s), arg);
                    }
                }
            }
            byId.Instruction = (byId.Instruction ?? "");
            if (byId.Instruction.ToLower().Contains("script"))
            {
                this.Instruction.InnerHtml = byId.Instruction.ToLower().Replace("script", "scrript").Replace("\r\n", "<br>");
            }
            else
            {
                this.Instruction.InnerHtml = byId.Instruction.Replace("\r\n", "<br>");
            }
        }
        else
        {
            MessageBox.ShowAndRedirect(this, "您没有权限查看!", "TaskMenu.aspx");
        }
    }
Esempio n. 4
0
		protected void Accept_Btn(object sender, EventArgs e)
		{
			if (!string.IsNullOrEmpty(base.Request.QueryString["tid"]))
			{
				string value = base.Request.QueryString["tid"];
				TasksInfo byId = Tasks.Init().GetById(Convert.ToInt32(value));
				IList all = Tasks_User.Init().GetAll(string.Concat(new object[]
				{
					"TaskID=",
					byId.id,
					" and UserID=",
					this.Uid,
					" and WorkTag=-1"
				}), null);
				if (all.Count == 1)
				{
					Tasks_UserInfo tasks_UserInfo = all[0] as Tasks_UserInfo;
					tasks_UserInfo.WorkTag = 1;
					tasks_UserInfo.AddTime = DateTime.Now.ToString("yy-M-dd HH:mm");
					Tasks_User.Init().Update(tasks_UserInfo);
					byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
					TasksInfo expr_FE = byId;
					string records = expr_FE.Records;
					expr_FE.Records = string.Concat(new string[]
					{
						records,
						"<font color='#2828ff'>[执行者]</font> <strong>",
						this.RealName,
						"(",
						this.DepName,
						")</strong> 在 ",
						Utils.ConvertDate3(DateTime.Now),
						" 操作:<font color='#2828ff'>接收了任务!</font> <br><br>"
					});
					Tasks.Init().Update(byId);
					string str = HttpContext.Current.Server.HtmlEncode("您好!操作成功,任务已接收!");
					base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
				}
			}
		}
Esempio n. 5
0
 protected void Accept_Btn(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["tid"]))
     {
         string    value = base.Request.QueryString["tid"];
         TasksInfo byId  = Tasks.Init().GetById(Convert.ToInt32(value));
         IList     all   = Tasks_User.Init().GetAll(string.Concat(new object[]
         {
             "TaskID=",
             byId.id,
             " and UserID=",
             this.Uid,
             " and WorkTag=-1"
         }), null);
         if (all.Count == 1)
         {
             Tasks_UserInfo tasks_UserInfo = all[0] as Tasks_UserInfo;
             tasks_UserInfo.WorkTag = 1;
             tasks_UserInfo.AddTime = DateTime.Now.ToString("yy-M-dd HH:mm");
             Tasks_User.Init().Update(tasks_UserInfo);
             byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
             TasksInfo expr_FE = byId;
             string    records = expr_FE.Records;
             expr_FE.Records = string.Concat(new string[]
             {
                 records,
                 "<font color='#2828ff'>[执行者]</font> <strong>",
                 this.RealName,
                 "(",
                 this.DepName,
                 ")</strong> 在 ",
                 Utils.ConvertDate3(DateTime.Now),
                 " 操作:<font color='#2828ff'>接收了任务!</font> <br><br>"
             });
             Tasks.Init().Update(byId);
             MessageBox.ShowAndRedirect(this, "操作成功,任务已接收!", "TaskMenu.aspx");
         }
     }
 }
Esempio n. 6
0
    protected void Del_Btn(object obj, EventArgs e)
    {
        LinkButton        linkButton        = obj as LinkButton;
        RepeaterItem      repeaterItem      = linkButton.Parent as RepeaterItem;
        HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
        int       id   = Convert.ToInt32(htmlInputCheckBox.Value);
        TasksInfo byId = Tasks.Init().GetById(id);
        IList     all  = Tasks_User.Init().GetAll("TaskID=" + byId.id, null);

        if (all.Count > 0)
        {
            int i     = 0;
            int count = all.Count;
            while (i < count)
            {
                Tasks_UserInfo tasks_UserInfo = all[i] as Tasks_UserInfo;
                try
                {
                    Help.DeleteFiles(tasks_UserInfo.FilePath);
                }
                catch
                {
                }
                i++;
            }
            string cmdText = "delete from Tasks_User where TaskID=" + byId.id;
            MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]);
        }
        try
        {
            Help.DeleteFiles(byId.FilePath);
        }
        catch
        {
        }
        Tasks.Init().Delete(id);
        this.Show(base.Request.QueryString["type"]);
    }
Esempio n. 7
0
 protected void Save_Btn(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["tuid"]))
     {
         string         text        = base.Request.QueryString["tuid"];
         Tasks_UserInfo byId        = Tasks_User.Init().GetById(Convert.ToInt32(text));
         Tasks_UserInfo expr_4D     = byId;
         string         instruction = expr_4D.Instruction;
         expr_4D.Instruction = string.Concat(new string[]
         {
             instruction,
             "<font color='#0055ff'>",
             base.Request.Form["pz"],
             "</font> -- ",
             this.RealName,
             " (",
             DateTime.Now.ToString("yy-M-dd HH:mm"),
             ")<br><hr />"
         });
         Tasks_User.Init().Update(byId);
         this.Show(text);
     }
 }
Esempio n. 8
0
		protected void Submit_Btn(object sender, EventArgs e)
		{
			if (!string.IsNullOrEmpty(base.Request.QueryString["tid"]))
			{
				string value = base.Request.QueryString["tid"];
				TasksInfo byId = Tasks.Init().GetById(Convert.ToInt32(value));
				IList all = Tasks_User.Init().GetAll(string.Concat(new object[]
				{
					"TaskID=",
					byId.id,
					" and UserID=",
					this.Uid,
					" and WorkTag=1"
				}), null);
				if (all.Count == 1)
				{
					Tasks_UserInfo tasks_UserInfo = all[0] as Tasks_UserInfo;
					tasks_UserInfo.WorkTag = 2;
					tasks_UserInfo.AddTime = DateTime.Now.ToString("yy-M-dd HH:mm");
					tasks_UserInfo.TaskID = byId.id;
					tasks_UserInfo.RealName = this.RealName;
					tasks_UserInfo.UserID = Convert.ToInt32(this.Uid);
					tasks_UserInfo.DepName = this.DepName;
					tasks_UserInfo.FilePath = this.UpdateFiles();
					tasks_UserInfo.WorkTitle = base.Request.Form["WorkTitle"];
					tasks_UserInfo.WorkNotes = base.Request.Form["Bodys"];
					tasks_UserInfo.Instruction = "";
					Tasks_User.Init().Update(tasks_UserInfo);
					byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
					TasksInfo expr_188 = byId;
					string records = expr_188.Records;
					expr_188.Records = string.Concat(new string[]
					{
						records,
						"<font color='#2828ff'>[执行者]</font> <strong>",
						this.RealName,
						"(",
						this.DepName,
						")</strong> 在 ",
						Utils.ConvertDate3(DateTime.Now),
						" 操作:<font color='#006600'>首次提交了执行情况!</font> <br><br>"
					});
					Tasks.Init().Update(byId);
					string str = HttpContext.Current.Server.HtmlEncode("您好!操作成功,执行情况已提交!");
					base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
				}
				else
				{
					Tasks_UserInfo tasks_UserInfo = new Tasks_UserInfo();
					tasks_UserInfo.WorkTag = 2;
					tasks_UserInfo.AddTime = DateTime.Now.ToString("yy-M-dd HH:mm");
					tasks_UserInfo.TaskID = byId.id;
					tasks_UserInfo.RealName = this.RealName;
					tasks_UserInfo.UserID = Convert.ToInt32(this.Uid);
					tasks_UserInfo.DepName = this.DepName;
					tasks_UserInfo.FilePath = this.UpdateFiles();
					tasks_UserInfo.WorkTitle = base.Request.Form["WorkTitle"];
					tasks_UserInfo.WorkNotes = base.Request.Form["Bodys"];
					tasks_UserInfo.Instruction = "";
					Tasks_User.Init().Add(tasks_UserInfo);
					byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
					TasksInfo expr_320 = byId;
					string records = expr_320.Records;
					expr_320.Records = string.Concat(new string[]
					{
						records,
						"<font color='#2828ff'>[执行者]</font> <strong>",
						this.RealName,
						"(",
						this.DepName,
						")</strong> 在 ",
						Utils.ConvertDate3(DateTime.Now),
						" 操作:<font color='#006600'>提交了执行情况!</font> <br><br>"
					});
					Tasks.Init().Update(byId);
					string str = HttpContext.Current.Server.HtmlEncode("您好!操作成功,执行情况已提交!");
					base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
				}
			}
		}
Esempio n. 9
0
 protected void Submit_Btn(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["tid"]))
     {
         string    value = base.Request.QueryString["tid"];
         TasksInfo byId  = Tasks.Init().GetById(Convert.ToInt32(value));
         IList     all   = Tasks_User.Init().GetAll(string.Concat(new object[]
         {
             "TaskID=",
             byId.id,
             " and UserID=",
             this.Uid,
             " and WorkTag=1"
         }), null);
         if (all.Count == 1)
         {
             Tasks_UserInfo tasks_UserInfo = all[0] as Tasks_UserInfo;
             tasks_UserInfo.WorkTag     = 2;
             tasks_UserInfo.AddTime     = DateTime.Now.ToString("yy-M-dd HH:mm");
             tasks_UserInfo.TaskID      = byId.id;
             tasks_UserInfo.RealName    = this.RealName;
             tasks_UserInfo.UserID      = Convert.ToInt32(this.Uid);
             tasks_UserInfo.DepName     = this.DepName;
             tasks_UserInfo.FilePath    = this.UpdateFiles();
             tasks_UserInfo.WorkTitle   = "从手机提交的执行情况..";
             tasks_UserInfo.WorkNotes   = base.Request.Form["Bodys"];
             tasks_UserInfo.WorkNotes   = "";
             tasks_UserInfo.Instruction = "";
             Tasks_User.Init().Update(tasks_UserInfo);
             byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
             TasksInfo expr_184 = byId;
             string    records  = expr_184.Records;
             expr_184.Records = string.Concat(new string[]
             {
                 records,
                 "<font color='#2828ff'>[执行者]</font> <strong>",
                 this.RealName,
                 "(",
                 this.DepName,
                 ")</strong> 在 ",
                 Utils.ConvertDate3(DateTime.Now),
                 " 操作:<font color='#006600'>首次提交了执行情况!</font> <br><br>"
             });
             Tasks.Init().Update(byId);
             MessageBox.ShowAndRedirect(this, "操作成功,任务已提交!", "TaskMenu.aspx");
         }
         else
         {
             Tasks_UserInfo tasks_UserInfo = new Tasks_UserInfo();
             tasks_UserInfo.WorkTag     = 2;
             tasks_UserInfo.AddTime     = DateTime.Now.ToString("yy-M-dd HH:mm");
             tasks_UserInfo.TaskID      = byId.id;
             tasks_UserInfo.RealName    = this.RealName;
             tasks_UserInfo.UserID      = Convert.ToInt32(this.Uid);
             tasks_UserInfo.DepName     = this.DepName;
             tasks_UserInfo.FilePath    = this.UpdateFiles();
             tasks_UserInfo.WorkTitle   = "从手机提交的执行情况..";
             tasks_UserInfo.WorkNotes   = this.Bodys.Value;
             tasks_UserInfo.Instruction = "";
             Tasks_User.Init().Add(tasks_UserInfo);
             byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
             TasksInfo expr_2D0 = byId;
             string    records  = expr_2D0.Records;
             expr_2D0.Records = string.Concat(new string[]
             {
                 records,
                 "<font color='#2828ff'>[执行者]</font> <strong>",
                 this.RealName,
                 "(",
                 this.DepName,
                 ")</strong> 在 ",
                 Utils.ConvertDate3(DateTime.Now),
                 " 操作:<font color='#006600'>提交了执行情况!</font> <br><br>"
             });
             Tasks.Init().Update(byId);
             MessageBox.ShowAndRedirect(this, "操作成功,任务已提交!", "TaskMenu.aspx");
         }
     }
 }
Esempio n. 10
0
		private void UpdateTasksUser(string old_str, string new_str, TasksInfo tk)
		{
			List<string> list = new List<string>();
			List<string> list2 = new List<string>();
			List<string> list3 = new List<string>();
			List<string> list4 = new List<string>();
			if (old_str.Contains(","))
			{
				string[] array = old_str.Split(new char[]
				{
					','
				});
				int i = 0;
				int num = array.Length;
				while (i < num)
				{
					if (array[i].Contains("#"))
					{
						list.Add(array[i]);
					}
					i++;
				}
			}
			if (new_str.Contains(","))
			{
				string[] array = new_str.Split(new char[]
				{
					','
				});
				int i = 0;
				int num = array.Length;
				while (i < num)
				{
					if (array[i].Contains("#"))
					{
						list2.Add(array[i]);
					}
					i++;
				}
			}
			string text = string.Join("!", list.ToArray());
			string text2 = string.Join("!", list2.ToArray());
			string[] array2 = list.ToArray();
			string[] array3 = list2.ToArray();
			for (int i = 0; i < array2.Length; i++)
			{
				if (text2.IndexOf(array2[i]) == -1)
				{
					list4.Add(array2[i]);
				}
			}
			for (int i = 0; i < array3.Length; i++)
			{
				if (text.IndexOf(array3[i]) == -1)
				{
					list3.Add(array3[i]);
				}
			}
			foreach (string current in list3)
			{
				if (current.Contains("#"))
				{
					Tasks_UserInfo tasks_UserInfo = new Tasks_UserInfo();
					tasks_UserInfo.TaskID = tk.id;
					tasks_UserInfo.RealName = current.Split(new char[]
					{
						'#'
					})[0];
					tasks_UserInfo.UserID = Convert.ToInt32(current.Split(new char[]
					{
						'#'
					})[1]);
					tasks_UserInfo.DepName = current.Split(new char[]
					{
						'#'
					})[2];
					tasks_UserInfo.AddTime = "";
					tasks_UserInfo.WorkTag = -1;
					tasks_UserInfo.Instruction = "";
					Tasks_User.Init().Add(tasks_UserInfo);
					string title = "[系统通知] : " + tasks_UserInfo.RealName + ", 您好! 您有新工作任务需要执行!";
					string content = string.Concat(new string[]
					{
						"任务名称:<strong>",
						tk.TaskName,
						"</strong><br>任务分类:",
						tk.TypeName,
						" <br>任务级别:",
						tk.Important,
						"<br>任务管理者:",
						tk.ManageNameList,
						"<br>"
					});
					int userID = tasks_UserInfo.UserID;
					string text3 = string.Concat(new object[]
					{
						tasks_UserInfo.RealName,
						"#",
						tasks_UserInfo.id,
						"#",
						tasks_UserInfo.DepName,
						","
					});
					string text4 = tasks_UserInfo.RealName + "(" + tasks_UserInfo.DepName + "),";
					Help.AdminSendMail(title, content, userID, text3, text4);
				}
			}
			foreach (string current in list4)
			{
				if (current.Contains("#"))
				{
					IList all = Tasks_User.Init().GetAll("UserID=" + current.Split(new char[]
					{
						'#'
					})[1], null);
					foreach (object current2 in all)
					{
						Tasks_UserInfo tasks_UserInfo = current2 as Tasks_UserInfo;
						try
						{
							Help.DeleteFiles(tasks_UserInfo.FilePath);
						}
						catch
						{
						}
						Tasks_User.Init().Delete(tasks_UserInfo.id);
					}
				}
			}
		}
Esempio n. 11
0
		private void AddTasksUser(string ulist, int tid, TasksInfo tk)
		{
			if (ulist.Contains(","))
			{
				string[] array = ulist.Split(new char[]
				{
					','
				});
				int i = 0;
				int num = array.Length;
				while (i < num)
				{
					if (array[i].Contains("#"))
					{
						Tasks_UserInfo tasks_UserInfo = new Tasks_UserInfo();
						tasks_UserInfo.TaskID = tid;
						tasks_UserInfo.RealName = array[i].Split(new char[]
						{
							'#'
						})[0];
						tasks_UserInfo.UserID = Convert.ToInt32(array[i].Split(new char[]
						{
							'#'
						})[1]);
						tasks_UserInfo.DepName = array[i].Split(new char[]
						{
							'#'
						})[2];
						tasks_UserInfo.AddTime = "";
						tasks_UserInfo.WorkTag = -1;
						tasks_UserInfo.Instruction = "";
						Tasks_User.Init().Add(tasks_UserInfo);
						string title = "[系统通知] : " + tasks_UserInfo.RealName + ", 您好! 您有新工作任务需要执行!";
						string content = string.Concat(new string[]
						{
							"任务名称:<strong>",
							tk.TaskName,
							"</strong><br>任务分类:",
							tk.TypeName,
							" <br>任务级别:",
							tk.Important,
							"<br>任务管理者:",
							tk.ManageNameList,
							"<br>"
						});
						int userID = tasks_UserInfo.UserID;
						string text = string.Concat(new object[]
						{
							tasks_UserInfo.RealName,
							"#",
							tasks_UserInfo.id,
							"#",
							tasks_UserInfo.DepName,
							","
						});
						string text2 = tasks_UserInfo.RealName + "(" + tasks_UserInfo.DepName + "),";
						Help.AdminSendMail(title, content, userID, text, text2);
					}
					i++;
				}
			}
		}