public static void getdata(SystemProcessThreadModel obj) { ControlPanel.Core.Entities.SystemProcessThread SystemProcessThreadEntity = new ControlPanel.Core.Entities.SystemProcessThread(); var continuouschk = obj.Continuous; var isnewsysprocess = obj.SystemProcessId; if (isnewsysprocess == "-1") { var sysId = addsystemprocess(obj); SystemProcessThreadEntity.SystemProcessId = sysId; } else { SystemProcessThreadEntity.SystemProcessId = Convert.ToInt16(obj.SystemProcessId); } TimeSpan scheduleTime; SystemProcessThreadEntity.Name = obj.Name; SystemProcessThreadEntity.Description = obj.Description; SystemProcessThreadEntity.SpringEntryName = obj.SpringEntryName; TimeSpan.TryParse(obj.ScheduledTime, out scheduleTime); SystemProcessThreadEntity.ScheduledTime = scheduleTime; SystemProcessThreadEntity.Enabled = false; if (continuouschk == "on") { SystemProcessThreadEntity.Continuous = true; } else { SystemProcessThreadEntity.Continuous = false; } SystemProcessThreadEntity.SleepTime = 10; SystemProcessThreadEntity.AutoStart = false; SystemProcessThreadEntity.ContinuousDelay = Convert.ToInt16(obj.ContinuousDelay); SystemProcessThreadEntity.IsDeleted = false; SystemProcessThreadEntity.DisplayOrder = "0"; SystemProcessThreadEntity.Argument = obj.Argument; ControlPanel.Repository.SystemProcessThreadRepository sptrepo = new ControlPanel.Repository.SystemProcessThreadRepository(); var threadId = obj.HiddenField; if (threadId == null) { sptrepo.InsertSystemProcessThread(SystemProcessThreadEntity); } else { SystemProcessThreadEntity.SystemProcessThreadId = Convert.ToInt16(threadId); sptrepo.UpdateSystemProcessThread(SystemProcessThreadEntity); } }
public static void removeEntries(string id) { ControlPanel.Repository.SystemProcessThreadRepository sptr = new ControlPanel.Repository.SystemProcessThreadRepository(); var thread = sptr.GetSystemProcessThread(Convert.ToInt16(id)); bool result = sptr.DeleteSystemProcessThread(Convert.ToInt16(id)); if (result) { var threadsofprocess = sptr.GetSystemProcessThreadBySystemProcessId(thread.SystemProcessId); if (threadsofprocess == null) { ControlPanel.Repository.SystemProcessRepository spr = new Repository.SystemProcessRepository(); spr.DeleteSystemProcess(thread.SystemProcessId); } } }
public static void getdata(SystemProcessThreadModel obj) { ControlPanel.Core.Entities.SystemProcessThread SystemProcessThreadEntity = new ControlPanel.Core.Entities.SystemProcessThread(); var continuouschk = obj.Continuous; var isnewsysprocess = obj.SystemProcessId; if (isnewsysprocess == "-1") { var sysId = addsystemprocess(obj); SystemProcessThreadEntity.SystemProcessId = sysId; } else { SystemProcessThreadEntity.SystemProcessId = Convert.ToInt16(obj.SystemProcessId); } TimeSpan scheduleTime; SystemProcessThreadEntity.Name = obj.Name; SystemProcessThreadEntity.Description = obj.Description; SystemProcessThreadEntity.SpringEntryName = obj.SpringEntryName; TimeSpan.TryParse(obj.ScheduledTime, out scheduleTime); SystemProcessThreadEntity.ScheduledTime = scheduleTime; SystemProcessThreadEntity.Enabled = false; if (continuouschk == "on") SystemProcessThreadEntity.Continuous = true; else SystemProcessThreadEntity.Continuous = false; SystemProcessThreadEntity.SleepTime = 10; SystemProcessThreadEntity.AutoStart = false; SystemProcessThreadEntity.ContinuousDelay = Convert.ToInt16(obj.ContinuousDelay); SystemProcessThreadEntity.IsDeleted = false; SystemProcessThreadEntity.DisplayOrder = "0"; SystemProcessThreadEntity.Argument = obj.Argument; ControlPanel.Repository.SystemProcessThreadRepository sptrepo = new ControlPanel.Repository.SystemProcessThreadRepository(); var threadId = obj.HiddenField; if (threadId == null) { sptrepo.InsertSystemProcessThread(SystemProcessThreadEntity); } else { SystemProcessThreadEntity.SystemProcessThreadId = Convert.ToInt16(threadId); sptrepo.UpdateSystemProcessThread(SystemProcessThreadEntity); } }
public static void removeEntries(string id) { ControlPanel.Repository.SystemProcessThreadRepository sptr = new ControlPanel.Repository.SystemProcessThreadRepository(); bool result = sptr.DeleteSystemProcessThread(Convert.ToInt16(id)); }
public static void removeEntries(string id) { ControlPanel.Repository.SystemProcessThreadRepository sptr = new ControlPanel.Repository.SystemProcessThreadRepository(); bool result = sptr.DeleteSystemProcessThread(Convert.ToInt16(id)); }
public static void removeEntries(string id) { ControlPanel.Repository.SystemProcessThreadRepository sptr = new ControlPanel.Repository.SystemProcessThreadRepository(); var thread = sptr.GetSystemProcessThread(Convert.ToInt16(id)); bool result = sptr.DeleteSystemProcessThread(Convert.ToInt16(id)); if (result) { var threadsofprocess = sptr.GetSystemProcessThreadBySystemProcessId(thread.SystemProcessId); if (threadsofprocess == null) { ControlPanel.Repository.SystemProcessRepository spr = new Repository.SystemProcessRepository(); spr.DeleteSystemProcess(thread.SystemProcessId); } } }