Esempio n. 1
0
        public void Delete(int id)
        {
            TasksInfo tasksInfo = new TasksInfo();

            tasksInfo.id = id;
            this.control.DeleteEntity(tasksInfo);
        }
Esempio n. 2
0
 protected void Complete_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));
         byId.Status     = 2;
         byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
         TasksInfo expr_6C = byId;
         string    records = expr_6C.Records;
         expr_6C.Records = string.Concat(new string[]
         {
             records,
             "<font color='#ff0000'>[管理者]</font> <strong>",
             this.RealName,
             "(",
             this.DepName,
             ")</strong> 在 ",
             Utils.ConvertDate3(DateTime.Now),
             " 操作:<strong style='color:#006600'>任务完成!</strong> <br><br>"
         });
         Tasks.Init().Update(byId);
         MessageBox.ShowAndRedirect(this, "操作成功,任务已完成!", "TaskMenu.aspx");
     }
 }
Esempio n. 3
0
		protected void Complete_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));
				byId.Status = 2;
				byId.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
				TasksInfo expr_6C = byId;
				string records = expr_6C.Records;
				expr_6C.Records = string.Concat(new string[]
				{
					records,
					"<font color='#ff0000'>[管理者]</font> <strong>",
					this.RealName,
					"(",
					this.DepName,
					")</strong> 在 ",
					Utils.ConvertDate3(DateTime.Now),
					" 操作:<strong style='color:#006600'>任务完成!</strong> <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. 4
0
        //-----------------------------------------------------------------------------------------------
        //-----------------------------------------------------------------------------------------------
        //constructor
        public ProjectGenerator(ControllerInfo controllerInfo, DataTypesInfo dataTablesInfo,
                                ModulesInfo modulesInfo, AddOnInstructionDefinitionsInfo addOnInstructionDefinitionsInfo,
                                TagsInfo tagsInfo, ProgramsInfo programsInfo, TasksInfo tasksInfo)
        {
            var initControllerInfo = new InitControllerInfo(controllerInfo);

            ControllerInfo = initControllerInfo.InitializedData();

            var initDataTypesInfo = new InitDataTypesInfo(dataTablesInfo);

            DataTypesInfo = initDataTypesInfo.InitializedData();

            var initModulesInfo = new InitModulesInfo(modulesInfo);

            ModulesInfo = initModulesInfo.InitializedData();

            var initAddOnInstructionDefinitionsInfo = new InitAddOnInstructionDefinitionsInfo(addOnInstructionDefinitionsInfo);

            AddOnInstructionDefinitionsInfo = initAddOnInstructionDefinitionsInfo.InitializedData();

            var initGlobalTagsInfo = new InitTagsInfo(tagsInfo);

            TagsInfo = initGlobalTagsInfo.InitializedData();

            var initProgramsInfo = new InitProgramsInfo(programsInfo);

            ProgramsInfo = initProgramsInfo.InitializedData();

            var initTasksInfo = new InitTasksInfo(tasksInfo);

            TasksInfo = initTasksInfo.InitializedData();
        }
Esempio n. 5
0
        public virtual TasksInfo GetJobTasks(HttpServletRequest hsr, string jid, string type
                                             )
        {
            Init();
            Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString
                                                                 (jid, ctx);
            CheckAccess(job, hsr);
            TasksInfo allTasks = new TasksInfo();

            foreach (Task task in job.GetTasks().Values)
            {
                TaskType ttype = null;
                if (type != null && !type.IsEmpty())
                {
                    try
                    {
                        ttype = MRApps.TaskType(type);
                    }
                    catch (YarnRuntimeException)
                    {
                        throw new BadRequestException("tasktype must be either m or r");
                    }
                }
                if (ttype != null && task.GetType() != ttype)
                {
                    continue;
                }
                allTasks.Add(new TaskInfo(task));
            }
            return(allTasks);
        }
Esempio n. 6
0
        private void Get(string mode = "", string sortby = "")
        {
            TaskInfoManager mgr = new TaskInfoManager();
            List <TaskInfo> SortedProjectList;

            TasksInfo = mgr.Get(SearchEntity, TasksInfo, mode);
            string sortbycommand = string.IsNullOrEmpty(sortby) ? "" : Convert.ToString(sortby).ToLower();

            switch (sortbycommand)

            {
            case "startdate":
                SortedProjectList = TasksInfo.OrderBy(o => o.StartDate).ToList();
                TasksInfo         = SortedProjectList;
                break;

            case "enddate":
                SortedProjectList = TasksInfo.OrderBy(o => o.EndDate).ToList();
                TasksInfo         = SortedProjectList;
                break;

            case "priority":
                SortedProjectList = TasksInfo.OrderBy(o => o.Priority).ToList();
                TasksInfo         = SortedProjectList;
                break;

            default:
                break;
            }
            //projectsInfo = students.OrderByDescending(s => s.LastName);
        }
Esempio n. 7
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. 8
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. 9
0
        public IActionResult Index()
        {
            var model = new HomeOutputViewModel
            {
                Tasks = TasksInfo.GetAvailableTasks()
            };

            return(View(model));
        }
Esempio n. 10
0
    private void DeleteTasks(int rid)
    {
        try
        {
            IList all = Tasks.Init().GetAll("TypeID=" + rid, null);
            if (all != null && all.Count > 0)
            {
                foreach (object current in all)
                {
                    TasksInfo tasksInfo = current as TasksInfo;
                    Help.DeleteFiles(tasksInfo.FilePath);
                }
            }
        }
        catch
        {
        }
        string cmdText = "delete from Tasks where typeid=" + rid;

        MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]);
    }
Esempio n. 11
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. 12
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. 13
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. 14
0
 public void Update(TasksInfo Tasks_)
 {
     this.control.UpdateEntity(Tasks_, Tasks_.id);
 }
Esempio n. 15
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. 16
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++;
				}
			}
		}
Esempio n. 17
0
		private void SendManageMail(bool isadd, string old_str, string new_str, TasksInfo tk)
		{
			if (isadd)
			{
				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("#"))
						{
							string title = "[系统通知] : " + array[i].Split(new char[]
							{
								'#'
							})[0] + ", 您好! 您有新工作任务需要管理!";
							string content = string.Concat(new string[]
							{
								"任务名称:<strong>",
								tk.TaskName,
								"</strong><br>任务分类:",
								tk.TypeName,
								" <br>任务级别:",
								tk.Important,
								"<br>任务管理者:",
								tk.ManageNameList,
								"<br>"
							});
							int receiverid = Convert.ToInt32(array[i].Split(new char[]
							{
								'#'
							})[1]);
							string text = string.Concat(new string[]
							{
								array[i].Split(new char[]
								{
									'#'
								})[0],
								"#",
								array[i].Split(new char[]
								{
									'#'
								})[1],
								"#",
								array[i].Split(new char[]
								{
									'#'
								})[2],
								","
							});
							string text2 = array[i].Split(new char[]
							{
								'#'
							})[0] + "(" + array[i].Split(new char[]
							{
								'#'
							})[2] + "),";
							Help.AdminSendMail(title, content, receiverid, text, text2);
						}
						i++;
					}
				}
			}
			else
			{
				List<string> list = new List<string>();
				List<string> list2 = new List<string>();
				List<string> list3 = 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 text3 = string.Join("!", list.ToArray());
				string.Join("!", list2.ToArray());
				string[] array2 = list2.ToArray();
				for (int i = 0; i < array2.Length; i++)
				{
					if (text3.IndexOf(array2[i]) == -1)
					{
						list3.Add(array2[i]);
					}
				}
				foreach (string current in list3)
				{
					if (current.Contains("#"))
					{
						string title = "[系统通知] : " + current.Split(new char[]
						{
							'#'
						})[0] + ", 您好! 您有新工作任务需要管理!";
						string content = string.Concat(new string[]
						{
							"任务名称:<strong>",
							tk.TaskName,
							"</strong><br>任务分类:",
							tk.TypeName,
							" <br>任务级别:",
							tk.Important,
							"<br>任务管理者:",
							tk.ManageNameList,
							"<br>"
						});
						int receiverid = Convert.ToInt32(current.Split(new char[]
						{
							'#'
						})[1]);
						string text = string.Concat(new string[]
						{
							current.Split(new char[]
							{
								'#'
							})[0],
							"#",
							current.Split(new char[]
							{
								'#'
							})[1],
							"#",
							current.Split(new char[]
							{
								'#'
							})[2],
							","
						});
						string text2 = current.Split(new char[]
						{
							'#'
						})[0] + "(" + current.Split(new char[]
						{
							'#'
						})[2] + "),";
						Help.AdminSendMail(title, content, receiverid, text, text2);
					}
				}
			}
		}
Esempio n. 18
0
        public static async Task <TaskInfo[]> ProjectTasks(int projectId)
        {
            TasksInfo inf = await Read <TasksInfo>($"Projects({projectId})/SE2.SimpleProject/Tasks?$expand=Parent($select=Id)&$select=Id,Parent,Order");

            return(inf.Infos);
        }
Esempio n. 19
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. 20
0
 public InitTasksInfo(TasksInfo tasksInfo)
 {
     TasksInfo = tasksInfo;
 }
Esempio n. 21
0
		private void Show()
		{
			SqlParameter sqlParameter = new SqlParameter();
			sqlParameter.ParameterName = "@uid";
			sqlParameter.Size = 50;
			sqlParameter.Value = this.Uid;
			SqlParameter sqlParameter2 = new SqlParameter();
			sqlParameter2.Direction = ParameterDirection.Output;
			sqlParameter2.ParameterName = "@pt0";
			sqlParameter2.Size = 4;
			SqlParameter sqlParameter3 = new SqlParameter();
			sqlParameter3.Direction = ParameterDirection.Output;
			sqlParameter3.ParameterName = "@pt1";
			sqlParameter3.Size = 4;
			SqlParameter sqlParameter4 = new SqlParameter();
			sqlParameter4.Direction = ParameterDirection.Output;
			sqlParameter4.ParameterName = "@pt2";
			sqlParameter4.Size = 4;
			SqlParameter sqlParameter5 = new SqlParameter();
			sqlParameter5.Direction = ParameterDirection.Output;
			sqlParameter5.ParameterName = "@pt3";
			sqlParameter5.Size = 4;
			SqlParameter[] cmdParms = new SqlParameter[]
			{
				sqlParameter2,
				sqlParameter3,
				sqlParameter4,
				sqlParameter5,
				sqlParameter
			};
			MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Tasks_GetTaskCount", cmdParms);
			this.t_all.InnerText = string.Concat(sqlParameter2.Value);
			this.t_exeute.InnerText = string.Concat(sqlParameter3.Value);
			this.t_manage.InnerText = string.Concat(sqlParameter4.Value);
			this.t_create.InnerText = string.Concat(sqlParameter5.Value);
			this.GetFirtNode();
			this.TypeID.DataSource = this.li;
			this.TypeID.DataTextField = "Sh";
			this.TypeID.DataValueField = "ID";
			this.TypeID.DataBind();
			if (!string.IsNullOrEmpty(base.Request.QueryString["tid"]))
			{
				this.user_manager.Disabled = true;
				TasksInfo byId = Tasks.Init().GetById(Convert.ToInt32(base.Request.QueryString["tid"]));
				if (byId.ManageUserList.Contains("#" + this.Uid + "#"))
				{
					this.ViewState["ti"] = byId;
					this.TaskName.Value = byId.TaskName;
					this.TypeID.SelectedValue = string.Concat(byId.TypeID);
					this.userlist.Value = byId.ManageUserList;
					this.namelist.Value = byId.ManageNameList;
					this.userlist_cc.Value = byId.ExecuteUserList;
					this.namelist_cc.Value = byId.ExecuteNameList;
					this.Bodys.Value = byId.Notes;
					this.ExpectTime.Value = byId.ExpectTime;
					this.Important.Value = byId.Important;
					this.IsOtherSee.Checked = Convert.ToBoolean(byId.IsOtherSee);
					this.OnceSubmit.Checked = Convert.ToBoolean(byId.OnceSubmit);
					if (!string.IsNullOrEmpty(byId.FilePath) && byId.FilePath.Contains("|"))
					{
						this.Attachword.Visible = true;
						List<TmpInfo> list = new List<TmpInfo>();
						string[] array = byId.FilePath.Split(new char[]
						{
							'|'
						});
						for (int i = 0; i < array.Length; i++)
						{
							if (array[i].Trim() != "")
							{
								TmpInfo tmpInfo = new TmpInfo();
								int num = array[i].LastIndexOf('/') + 1;
								string tmp = array[i].Substring(num, array[i].Length - num);
								string tmp2 = array[i].Replace("~", "");
								tmpInfo.Tmp1 = array[i];
								tmpInfo.Tmp2 = tmp;
								tmpInfo.Tmp3 = tmp2;
								list.Add(tmpInfo);
							}
						}
						this.rpt.DataSource = list;
						this.rpt.DataBind();
					}
				}
			}
		}
Esempio n. 22
0
 public GenerateTasks(TasksInfo tasksInfo)
 {
     _tasksInfo = tasksInfo;
 }
Esempio n. 23
0
		protected void Save_Btn(object sender, EventArgs e)
		{
			if (string.IsNullOrEmpty(base.Request.QueryString["tid"]))
			{
				TasksInfo tasksInfo = new TasksInfo();
				tasksInfo.TaskName = this.TaskName.Value;
				tasksInfo.TypeID = Convert.ToInt32(base.Request.Form["TypeID"]);
				tasksInfo.TypeName = this.ClearLeaf(this.TypeID.Items[this.TypeID.SelectedIndex].Text);
				tasksInfo.Important = base.Request.Form["Important"];
				tasksInfo.Status = 1;
				tasksInfo.IsOtherSee = Convert.ToInt32(this.IsOtherSee.Checked);
				tasksInfo.OnceSubmit = Convert.ToInt32(this.OnceSubmit.Checked);
				tasksInfo.CreatorID = Convert.ToInt32(this.Uid);
				tasksInfo.CreatorRealName = this.RealName;
				tasksInfo.CreatorDepName = this.DepName;
				tasksInfo.AddTime = DateTime.Now.ToString("yyyy-MM-dd");
				tasksInfo.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
				tasksInfo.ExpectTime = this.ExpectTime.Value;
				tasksInfo.Notes = this.Bodys.Value;
				tasksInfo.FilePath = this.UpdateFiles();
				TasksInfo expr_161 = tasksInfo;
				string records = expr_161.Records;
				expr_161.Records = string.Concat(new string[]
				{
					records,
					"<font color='#006600'>[创建人]</font> <strong>",
					this.RealName,
					"(",
					this.DepName,
					")</strong> 在 ",
					Utils.ConvertDate3(DateTime.Now),
					" <strong style='color:#ff0000'>创建了任务</strong> <br><br>"
				});
				tasksInfo.ManageUserList = this.userlist.Value;
				tasksInfo.ManageNameList = this.namelist.Value;
				tasksInfo.ExecuteUserList = this.userlist_cc.Value;
				tasksInfo.ExecuteNameList = this.namelist_cc.Value;
				Tasks.Init().Add(tasksInfo);
				this.SendManageMail(true, tasksInfo.ManageUserList, tasksInfo.ManageUserList, tasksInfo);
				this.AddTasksUser(tasksInfo.ExecuteUserList, tasksInfo.id, tasksInfo);
				string str = HttpContext.Current.Server.HtmlEncode("您好!工作任务已新建成功!");
				base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
			}
			else
			{
				TasksInfo tasksInfo = this.ViewState["ti"] as TasksInfo;
				if (tasksInfo.ManageUserList.Contains("#" + this.Uid + "#"))
				{
					tasksInfo.TaskName = this.TaskName.Value;
					tasksInfo.TypeID = Convert.ToInt32(this.TypeID.SelectedValue);
					tasksInfo.TypeName = this.ClearLeaf(this.TypeID.Items[this.TypeID.SelectedIndex].Text);
					tasksInfo.Important = base.Request.Form["Important"];
					tasksInfo.Status = 1;
					tasksInfo.IsOtherSee = Convert.ToInt32(this.IsOtherSee.Checked);
					tasksInfo.OnceSubmit = Convert.ToInt32(this.OnceSubmit.Checked);
					tasksInfo.UpdateTime = DateTime.Now.ToString("yy-M-dd HH:mm");
					tasksInfo.ExpectTime = this.ExpectTime.Value;
					tasksInfo.Notes = this.Bodys.Value;
					tasksInfo.FilePath = this.UpdateFiles();
					TasksInfo expr_3AF = tasksInfo;
					string records = expr_3AF.Records;
					expr_3AF.Records = string.Concat(new string[]
					{
						records,
						"<font color='#006600'>[管理者]</font> <strong>",
						this.RealName,
						"(",
						this.DepName,
						")</strong> 在 ",
						Utils.ConvertDate3(DateTime.Now),
						" <strong style='color:#ff0000'>重新编辑了任务</strong> <br><br>"
					});
					string executeUserList = tasksInfo.ExecuteUserList;
					string manageUserList = tasksInfo.ManageUserList;
					tasksInfo.ManageUserList = this.userlist.Value;
					tasksInfo.ManageNameList = this.namelist.Value;
					tasksInfo.ExecuteUserList = this.userlist_cc.Value;
					tasksInfo.ExecuteNameList = this.namelist_cc.Value;
					Tasks.Init().Update(tasksInfo);
					this.SendManageMail(false, manageUserList, tasksInfo.ManageUserList, tasksInfo);
					this.UpdateTasksUser(executeUserList, this.userlist_cc.Value, tasksInfo);
					string str = HttpContext.Current.Server.HtmlEncode("您好!工作任务已重新编辑!");
					base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
				}
			}
		}
Esempio n. 24
0
 public void Add(TasksInfo com)
 {
     Tasks.dal.Add(com);
 }
Esempio n. 25
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. 26
0
        private XElement Generate()
        {
            var userName = User.Identity.GetUserName();
            var xmlDB    = new XMLDatabase(userName, _context.Users.First(c => c.Name == userName).ActProject);

            String pageName;

            if (String.IsNullOrEmpty(userName))
            {
                pageName = "";
            }
            else
            {
                pageName = _context.Users.First(c => c.Name == userName).ActProject;
            }

            var controllerInfo = new ControllerInfo();
            var datatypesInfo  = new DataTypesInfo
            {
                Components = xmlDB.Components.ToList(),
                Standards  = xmlDB.Standards.ToList(),
                Locations  = xmlDB.Locations.ToList(),
                IOs        = xmlDB.IOs.ToList(),
                //DIPulseSetups = _context.DIpulses.ToList(),
                Modules = xmlDB.Modules.ToList(),
                //MotFrqSetups = _context.MotFrqs.ToList(),
                //DIAlarmSetups = _context.DIAlarms.ToList(),
                //AIAlarmSetups = _context.AIAlarms.ToList(),
                ApplyLocationFilter = false
            };

            var modulesInfo = new ModulesInfo
            {
                modules    = xmlDB.Modules.ToList(),
                controller = new ControllerInfo
                {
                    name        = "StdPLC",
                    description = "Standard controller"                   //TODO From database
                },
                IOs        = xmlDB.IOs.ToList(),
                Components = xmlDB.Components.ToList(),
                //MotFrqSetups = xmlDB.MotFrqs.ToList()
            };

            var tagsInfo = new TagsInfo();

            var programsInfo = new ProgramsInfo
            {
                IOs     = xmlDB.IOs.ToList(),
                Modules = xmlDB.Modules.ToList(),
                //AIAlarmSetups = xmlDB.AIAlarms.ToList(),
                //DIAlarmSetups = xmlDB.DIAlarms.ToList(),
                //DIPulseSetups = xmlDB.DIpulses.ToList(),
                //MDirSetups = xmlDB.MDirs.ToList(),
                //MRevSetups = xmlDB.MRevs.ToList(),
                //MotFrqSetups = xmlDB.MotFrqs.ToList(),
                //StdVlvSetups = xmlDB.StdVlvs.ToList(),
                Components = xmlDB.Components.ToList()
            };

            var tasksInfo = new TasksInfo();
            var addOnInstructionDefinitionsInfo = new AddOnInstructionDefinitionsInfo
            {
                Components = xmlDB.Components.ToList(),
                Standards  = xmlDB.Standards.ToList()
            };



            var generator = new ProjectGenerator(controllerInfo, datatypesInfo, modulesInfo, addOnInstructionDefinitionsInfo, tagsInfo, programsInfo, tasksInfo);


            return(generator.GenerateProject());
        }
Esempio n. 27
0
 public void Update(TasksInfo com)
 {
     Tasks.dal.Update(com);
 }
Esempio n. 28
0
 public void Add(TasksInfo Tasks_)
 {
     this.control.AddEntity(Tasks_);
 }