Exemplo n.º 1
0
 public SQL(SqlLogic logical, SqlCompare compare, string name, object value)
 {
     _logical = logical;
     _compare = compare;
     _name    = name;
     _value   = value;
 }
        public void Execute()
        {
            Console.WriteLine("Executing plugin");
            var sqlLogic = new SqlLogic();

            sqlLogic.CreateConnection();
        }
Exemplo n.º 3
0
 public SQL(SqlLogic logical, SqlCompare compare, string name, object value)
 {
     _logical = logical;
     _compare = compare;
     _name = name;
     _value = value;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance with the given table and AND/OR logic.
 /// </summary>
 /// <param name="root"></param>
 /// <param name="logic"></param>
 public DbQueryWhereClause(ISqlTable root, SqlLogic logic)
 {
     _root        = root;
     this.Filters = new SqlFilterCollection()
     {
         Logic = logic
     };
 }
Exemplo n.º 5
0
        public ActionResult DeleteConfirmed(int id)
        {
            Bug    bug            = SqlLogic.FindBug(id);
            string currentProject = bug.Project.ProjectName;

            SqlLogic.DeleteBugConfirmation(bug);

            return(RedirectToAction("Index", "Bugs", new { id = currentProject }));
        }
Exemplo n.º 6
0
 public ActionResult Edit(Bug bug, int id)
 {
     if (ModelState.IsValid)
     {
         Bug currentBug = SqlLogic.GetCurrentBug(bug);
         SqlLogic.EditBug(bug, id);
         return(RedirectToAction("Index", "Bugs", new { id = currentBug.Project.ProjectName }));
     }
     return(View(bug));
 }
Exemplo n.º 7
0
        public ActionResult Create([Bind(Include = "ID,ProjectName,ProjectDescription,ProfileID")] Project project)
        {
            if (ModelState.IsValid)
            {
                SqlLogic.CreateProject(project);
                return(RedirectToAction("Index"));
            }

            return(View(project));
        }
Exemplo n.º 8
0
        public ActionResult Edit(Project project)
        {
            if (ModelState.IsValid)
            {
                SqlLogic.EditProject(project);
                return(RedirectToAction("Index"));
            }

            return(View(project));
        }
Exemplo n.º 9
0
        public ActionResult Create([Bind(Include = "BugName,Priority,BugDescription,Status,ProjectID")] Bug bug, string id)
        {
            if (ModelState.IsValid)
            {
                SqlLogic.CreateBug(bug, id);
                return(RedirectToAction("Index", "Bugs", new { id = id }));
            }

            return(View(bug));
        }
Exemplo n.º 10
0
 public void RunImmediateBatchCreationTest()
 {
     using (var logic = new MessagesModuleLogic(new MessageContext(Settings.MessageContextConnectionString))) {
         using (var sqlLogic = new SqlLogic(new SqlConnectionFactory(Settings.SqlConnectionString))) {
             using (var Bcm = BatchCreationManager.NewInstance(new DateTime(2016, 9, 3), new DateTime(2016, 9, 5), sqlLogic, logic)) {
                 //TASK_PROTOTYPE.RunImmediateBatchCreation(logic.Get<tblMessageSchedule>(1), 1, sqlLogic, logic);
             }
         }
     }
 }
Exemplo n.º 11
0
        // GET: Projects/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project project = SqlLogic.FindProject(id);

            if (project == null)
            {
                return(HttpNotFound());
            }
            return(View(project));
        }
Exemplo n.º 12
0
        // GET: Bugs/Delete
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Bug bug = SqlLogic.FindBug(id);

            if (bug == null)
            {
                return(HttpNotFound());
            }
            return(View(bug));
        }
        public void CollectTest()
        {
            using (var logic = new MessagesModuleLogic(new MessageContext(Settings.MessageContextConnectionString))) {
                using (var sqlLogic = new SqlLogic(new SqlConnectionFactory(Settings.SqlConnectionString))) {
                    using (var Bcm = BatchCreationManager.NewInstance(new DateTime(2016, 9, 3), new DateTime(2016, 9, 5), sqlLogic, logic)) {
                        Bcm.DontMakeTimeStamp();
                        var sced = logic.Get <tblMessageSchedule>(1);

                        var Collector = new MessageDataCollector(Bcm);
                        var result    = Collector.Collect(sced);
                    }
                }
            }
        }
 public void BigTask_Example()
 {
     using (var logic = new MessagesModuleLogic(new MessageContext(Settings.MessageContextConnectionString))) {
         using (var sqlLogic = new SqlLogic(new SqlConnectionFactory(Settings.SqlConnectionString))) {
             using (var manager = NewInstance(new DateTime(2015, 9, 3), new DateTime(2017, 9, 5), sqlLogic, logic)) {
                 var shedules = manager.GetActualMessageSchedules();
                 var creator  = new BatchCreator(manager);
                 var results  = new List <BatchCreationResult>();
                 foreach (var sched in shedules)
                 {
                     results.Add(creator.CreateBatch(sched, 0));
                 }
                 //manager.SaveResultsToDB(results);
             }
         }
     }
 }
Exemplo n.º 15
0
        public void RenderWhere(IEnumerable <ISqlFilter> filters, SqlLogic logic, SqlBuildArguments args)
        {
            if (filters == null)
            {
                throw new ArgumentNullException("filters");
            }
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            var items = filters.ToArray();

            if (items.Length > 0)
            {
                this.WriteWhere();
                this.RenderAll(items, args, string.Concat(SqlConstants.SPACE, ConvertSqlLogicToString(logic), SqlConstants.SPACE));
            }
        }
Exemplo n.º 16
0
        // GET: Bugs
        public ActionResult Index(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            // If project does not exist, throw 404 error
            var project = db.Projects.Where(p => p.ProjectName == id).ToList();

            if (project.Count == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            List <Bug> allBugs = SqlLogic.GetBugsForCurrentProject(id).OrderBy(x => x.Status).ToList();

            return(View(allBugs));
        }
Exemplo n.º 17
0
 public virtual string ConvertLogicToString(SqlLogic logic)
 {
     return(ConvertSqlLogicToString(logic));
 }
Exemplo n.º 18
0
 public virtual void WriteLogic(SqlLogic logic)
 {
     this.Write(logic.ToString().ToUpper());
 }
Exemplo n.º 19
0
        // Returns only normal priority bugs for current project
        public ActionResult NormalPriority(string id)
        {
            List <Bug> normalBugs = SqlLogic.GetPriorityBugs("Normal", id).OrderBy(x => x.Status).ToList();

            return(View("Index", normalBugs));
        }
Exemplo n.º 20
0
        // Returns only low priority bugs for current project
        public ActionResult LowPriority(string id)
        {
            List <Bug> lowBugs = SqlLogic.GetPriorityBugs("Low", id).OrderBy(x => x.Status).ToList();

            return(View("Index", lowBugs));
        }
Exemplo n.º 21
0
        // Returns only low priority bugs for current project
        public ActionResult ImmediatePriority(string id)
        {
            List <Bug> immediateBugs = SqlLogic.GetPriorityBugs("Immediate", id).OrderBy(x => x.Status).ToList();

            return(View("Index", immediateBugs));
        }
Exemplo n.º 22
0
        // Returns only high priority bugs for current project
        public ActionResult HighPriority(string id)
        {
            List <Bug> highBugs = SqlLogic.GetPriorityBugs("High", id).OrderBy(x => x.Status).ToList();

            return(View("Index", highBugs));
        }
Exemplo n.º 23
0
        // GET: Projects
        public ActionResult Index()
        {
            List <Project> userProjects = SqlLogic.GetUserProjects();

            return(View(userProjects));
        }
Exemplo n.º 24
0
 public ActionResult DeleteConfirmed(int id)
 {
     SqlLogic.DeleteProjectConfirmation(id);
     return(RedirectToAction("Index"));
 }
Exemplo n.º 25
0
        // Sorts bug list where most recent bugs are before older ones
        public ActionResult SortByRecent(string id)
        {
            List <Bug> allBugs = SqlLogic.SortBugsByRecent(id).OrderBy(x => x.Status).ToList();

            return(View("Index", allBugs));
        }
Exemplo n.º 26
0
        // Sorts bug list by priority.  Order is low, normal, high, then immediate
        public ActionResult SortByPriority(string id)
        {
            IOrderedEnumerable <Bug> sortedByPriority = SqlLogic.SortBugsByPriority(id);

            return(View("Index", sortedByPriority));
        }
Exemplo n.º 27
0
 public static string ConvertSqlLogicToString(SqlLogic logic)
 {
     return(logic.ToString().ToUpper());
 }