Example #1
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (BugCur.Submitter == 0)
     {
         MessageBox.Show("A valid submitter wasn't picked.  Make sure the computer being used is associated to a buguser.");
         return;
     }
     if (!Bugs.VersionsAreValid(textVersionsFixed.Text))
     {
         MsgBox.Show("Please fix your version format. Must be like '18.4.8.0;19.1.22.0;19.2.3.0'");
         return;
     }
     if (textVersionsFixed.Text != "")
     {
         BugCur.Status_ = BugStatus.Fixed;
     }
     else if (comboStatus.SelectedIndex == 0)           //none
     {
         BugCur.Status_ = BugStatus.Accepted;
     }
     else
     {
         BugCur.Status_ = (BugStatus)Enum.Parse(typeof(BugStatus), comboStatus.Text);
     }
     SaveToDb();
     BugSubmissions.UpdateBugIds(BugCur.BugId, _listBugSubs);
     DialogResult = DialogResult.OK;
     Close();
 }
Example #2
0
        public async System.Threading.Tasks.Task AssignAssigneeToBug(Guid bugId, User.Model.Member assignee, IMembershipService authorizationService)
        {
            var bug = Bugs.Single(x => x.Id == bugId);
            await bug.AssignAssignee(assignee, authorizationService);

            Update(new AssigneeAssignedToBug(bug.Id, assignee.Id));
        }
Example #3
0
        public void GivenProjectName_WhenAskingForBugs_ThenItShouldReturnBugs()
        {
            // arrange
            IBugsFactory fakeBugsFactory = new FakeBugsFactory(new Bugs(new List <Bug>
            {
                new Bug(1, "thing1"),
                new Bug(2, "thing2")
            }));

            BugController bugController = new Privateer().Object <BugController>(fakeBugsFactory);

            // act
            OkObjectResult okObjectResult = (OkObjectResult)bugController.Bugs("HankHill").Result;

            // assert
            okObjectResult.StatusCode.Should().Be(200);
            Bugs    bugs    = (Bugs)okObjectResult.Value;
            JObject jObject = JObject.Parse(JsonConvert.SerializeObject(bugs));

            jObject["bugs"].Should().HaveCount(2);
            jObject["bugs"][0]["id"].Value <int>().Should().Be(1);
            jObject["bugs"][0]["url"].Value <string>().Should().Be("thing1");
            jObject["bugs"][1]["id"].Value <int>().Should().Be(2);
            jObject["bugs"][1]["url"].Value <string>().Should().Be("thing2");
        }
Example #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            Bugs bugs = this.bugmngr.BugById(id);

            this.bugmngr.Delete(bugs);
            return(RedirectToAction("Index"));
        }
Example #5
0
        //JİRADAN ISSUE'LARI ÇEK
        private List <JiraIssue> GetIssues()
        {
            int startAt                = 0;
            int totalValue             = GetTotalValue();
            List <JiraIssue> issueList = new List <JiraIssue>();


            for (int i = totalValue; i > 0; i = i - 25)  //TOTAL = TOTAL-MAXRESULT
            {
                string response = _jiraRequestService.GetBugs(startAt);
                Bugs   bugs     = JsonConvert.DeserializeObject <Bugs>(response);


                foreach (var issue in bugs.Issues)  //REQUESTTE DÖNEN TÜM BUGLARI EKLE
                {
                    issueList.Add(new JiraIssue
                    {
                        IssueID     = issue.Key,
                        Summary     = issue.Fields.Summary,
                        Type        = issue.Fields.issuetype.name,
                        Creator     = issue.Fields.Creator.DisplayName,
                        Created     = issue.Fields.Created,
                        LastUpdated = issue.Fields.Updated,
                        Status      = issue.Fields.Status.Name,
                        Severity    = (decimal?)issue.Fields.customfield_10029
                    });
                }     //TOTALVALUE-25 >0 İSE HALA BUG VAR DEMEK. DÖNGÜ BAŞA DÖNSÜN

                startAt += 25;
            }

            return(issueList);
        }
Example #6
0
        public async System.Threading.Tasks.Task AssignBugToSprint(Guid bugId, Guid sprintId, ISprintSearcher sprintSearcher)
        {
            var bug = Bugs.Single(x => x.Id == bugId);
            await bug.AssignToSprint(sprintId, sprintSearcher);

            Update(new BugAssignedToSprint(bug.Id, sprintId));
        }
Example #7
0
        protected override async Task AppendAsync(ILogger logger, LogMessage message, CancellationToken ct)
        {
            if (IsDisposed || !Check())
            {
                return;
            }
            try
            {
                var line = logger.Formatter.Format(logger, message);
                await Writer.WriteLineAsync(line);

                if (message.Exception != null)
                {
                    await Writer.WriteLineAsync(message.Exception.ToString());
                }
            }
            catch (ThreadAbortException)
            {
                // not sure why but happens sometimes in tests
            }
            catch (OperationCanceledException)
            {
            }
            catch (Exception e)
            {
                // this must be something serious.
                Bugs.Break(e);
            }
        }
        public Boolean UpdateBug(Bugs bug)
        {
            Boolean isUpdated = false;
            string  query     = "update bugs set projectName='" + bug.ProjectName + "', " +
                                "issue='" + bug.Issue + "'," +
                                "fileName='" + bug.FileName + "', lineNo='" + bug.LineNo + "', " +
                                "createdDate='" + bug.CreatedDate + "', status='" + bug.Status + "', fixby='" + bug.FixBy + "' where bugId ='" + bug.BugId + "';";

            try
            {
                databaseConnection.Open();
                commandDatabase = new MySqlCommand(query, databaseConnection);
                int updatedRow = commandDatabase.ExecuteNonQuery();
                if (updatedRow > 0)
                {
                    isUpdated = true;
                }
                databaseConnection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Query Error : " + ex.Message);
            }
            return(isUpdated);
        }
Example #9
0
        public async Task <IActionResult> Create([Bind("Id,ProjectId,BugPriorityId,BugStatusId,BugCreatedBy,BugCreatedOn,BugClosedBy,BugClosedOn,BugResolutionSummary")] Bugs bugs)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bugs);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BugPriorityId"] = new SelectList(_context.BugPriorities, "Id", "BugPriorityType", bugs.BugPriorityId);
            ViewData["BugStatusId"]   = new SelectList(_context.BugStatuses, "Id", "BugStatusType", bugs.BugStatusId);
            ViewData["ProjectId"]     = new SelectList(_context.Projects, "Id", "Description", bugs.ProjectId);
            return(View(bugs));

            //using (HttpClient client = new HttpClient())
            //{
            //    //instructor.Id = "0";
            //    client.BaseAddress = new Uri("https://localhost:5001");
            //    string stringData = JsonConvert.SerializeObject(bugs);
            //    var contentData = new StringContent(stringData,
            //                             System.Text.Encoding.UTF8,
            //                             "application/json");
            //    HttpResponseMessage response =
            //        client.PostAsync("/api/bugs", contentData)
            //              .Result;
            //    var status = response.StatusCode; //should be 201
            //    //ViewBag.Message = response.Content.ReadAsStringAsync().Result;
            //    return RedirectToAction(nameof(Index));
            //}
        }
Example #10
0
        private void FormJobNew_Load(object sender, EventArgs e)
        {
            textSearch.Text = InitialSearchString;
            listBoxUsers.Items.Add("Any");
            _listUsers = Userods.GetDeepCopy(true);
            _listUsers.ForEach(x => listBoxUsers.Items.Add(x.UserName));
            //Statuses
            listBoxStatus.Items.Add("Any");
            _listJobStatuses = Enum.GetValues(typeof(JobPhase)).Cast <JobPhase>().ToList();
            _listJobStatuses.ForEach(x => listBoxStatus.Items.Add(x.ToString()));
            //Categories
            listBoxCategory.Items.Add("Any");
            _listJobCategory = Enum.GetValues(typeof(JobCategory)).Cast <JobCategory>().ToList();
            _listJobCategory.ForEach(x => listBoxCategory.Items.Add(x.ToString()));
            ODThread thread = new ODThread((o) => {
                //We can reduce these calls to DB by passing in more data from calling class. if available.
                if (_listJobsAll == null)
                {
                    _listJobsAll = Jobs.GetAll();
                    Jobs.FillInMemoryLists(_listJobsAll);
                }
                try {
                    _listFeatureRequestsAll = FeatureRequests.GetAll();
                }
                catch (Exception ex) {
                    ex.DoNothing();
                    _listFeatureRequestsAll = new List <FeatureRequest>();
                }
                _listBugsAll = Bugs.GetAll();
                this.Invoke((Action)ReadyForSearch);
            });

            thread.AddExceptionHandler((ex) => { /*todo*/ });
            thread.Start();
        }
Example #11
0
        public void ModifyWorkItem(int workItemId, string comment, bool commentIsHtml, Dictionary <string, string> values, MessageAttachmentCollection attachments)
        {
            if (ThrowOnModifyBug != null)
            {
                throw ThrowOnModifyBug;
            }

            if (!Bugs.ContainsKey(workItemId))
            {
                Logger.WarnFormat("Trying to modify non-existing bug {0}. Initializing with no field values", workItemId);
                Bugs[workItemId] = new Dictionary <string, string>();
            }

            var bugEntry = Bugs[workItemId];

            foreach (var key in values.Keys)
            {
                bugEntry[key] = values[key];
            }

            if (!bugEntry.ContainsKey(HistoryField))
            {
                bugEntry[HistoryField] = "";
            }

            bugEntry[HistoryField] += comment;
        }
Example #12
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ProjectId,BugPriorityId,BugStatusId,BugCreatedBy,BugCreatedOn,BugClosedBy,BugClosedOn,BugResolutionSummary")] Bugs bugs)
        {
            if (id != bugs.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bugs);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BugsExists(bugs.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BugPriorityId"] = new SelectList(_context.BugPriorities, "Id", "BugPriorityType", bugs.BugPriorityId);
            ViewData["BugStatusId"]   = new SelectList(_context.BugStatuses, "Id", "BugStatusType", bugs.BugStatusId);
            ViewData["ProjectId"]     = new SelectList(_context.Projects, "Id", "Description", bugs.ProjectId);
            return(View(bugs));
        }
        public ActionResult Edit(int?Id)
        {
            Bugs bug = bugRepository.GetBugs(Id.Value);

            if (bug == null)
            {
                Response.StatusCode = 404;
                return(View("BugSearchedNotFound", Id.Value));
            }

            //Instance of Bugs created and populate with data retrieved from Database
            //Bugs bugs = new Bugs
            BugsEditViewModel bugs = new BugsEditViewModel
            {
                Id                   = bug.Id,
                ProjectId            = bug.ProjectId,
                BugPriorityId        = bug.BugPriorityId,
                BugStatusId          = bug.BugStatusId,
                BugCreatedBy         = bug.BugCreatedBy,
                BugCreatedOn         = bug.BugCreatedOn,
                BugClosedBy          = bug.BugClosedBy,
                BugClosedOn          = bug.BugClosedOn,
                BugResolutionSummary = bug.BugResolutionSummary,
                ExistingDocument     = bug.Attachment
            };

            if (bugs == null)
            {
                return(NotFound());
            }
            ViewData["BugPriorityId"] = new SelectList(bugPriorityRepository.GetAllBugPriorities(), "Id", "BugPriorityType");
            ViewData["BugStatusId"]   = new SelectList(bugStatusRepository.GetAllBugStatus(), "Id", "BugStatusType");
            ViewData["ProjectId"]     = new SelectList(projectRepository.GetAllProjects(), "Id", "Name");
            return(View(bugs));
        }
        public Boolean ReportBug(Bugs bug)
        {
            Boolean isReported = false;

            //fileStream = new FileStream(bug.ProjectName, FileMode.Open, FileAccess.Read);
            // binaryReader = new BinaryReader(fileStream);
            //binaryReader.Close();
            // fileStream.Close();
            string query = "insert into bugs (userName, projectName, issue, fileName, " +
                           "lineNo, createdDate, status)" +
                           "values ('" + bug.Username + "','" + bug.ProjectName + "','" + bug.Issue + "','" + bug.FileName + "','" + bug.LineNo + "','" + bug.CreatedDate + "','" + bug.Status + "');";

            try
            {
                databaseConnection.Open();
                commandDatabase = new MySqlCommand(query, databaseConnection);
                int affectedRows = commandDatabase.ExecuteNonQuery();
                if (affectedRows > 0)
                {
                    isReported = true;
                }
                databaseConnection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Query Error : " + ex.Message);
            }
            return(isReported);
        }
Example #15
0
        public void RegisterActions(Gtk.Application app, GLib.Menu menu)
        {
            app.AddAccelAction(Contents, "F1");
            menu.AppendItem(Contents.CreateMenuItem());

            app.AddAction(Website);
            menu.AppendItem(Website.CreateMenuItem());

            app.AddAction(Bugs);
            menu.AppendItem(Bugs.CreateMenuItem());

            app.AddAction(Translate);
            menu.AppendItem(Translate.CreateMenuItem());

            // This is part of the application menu on macOS.
            if (PintaCore.System.OperatingSystem != OS.Mac)
            {
                var about_section = new GLib.Menu();
                menu.AppendSection(null, about_section);

                var about = PintaCore.Actions.App.About;
                app.AddAction(about);
                about_section.AppendItem(about.CreateMenuItem());
            }
        }
Example #16
0
        public void ModifyWorkItem(int workItemId, IIncomingEmailMessage message, Dictionary <string, string> values)
        {
            if (ThrowOnModifyBug != null)
            {
                throw ThrowOnModifyBug;
            }

            if (!Bugs.ContainsKey(workItemId))
            {
                Logger.WarnFormat("Trying to modify non-existing bug {0}. Initializing with no field values", workItemId);
                Bugs[workItemId] = new Dictionary <string, string>();
            }

            var bugEntry = Bugs[workItemId];

            foreach (var key in values.Keys)
            {
                bugEntry[key] = values[key];
            }

            if (!bugEntry.ContainsKey(HistoryField))
            {
                bugEntry[HistoryField] = "";
            }

            bugEntry[HistoryField] += message.GetLastMessageText();
        }
Example #17
0
        /// <summary>
        /// insert bug details in database
        /// </summary>
        /// <param name="bugs"></param>
        /// <returns></returns>
        public Boolean AddBug(Bugs bugs)
        {
            Boolean add = false;

            //to open image
            byte[] Image;
            fileStream = new FileStream(bugs.Imgfile, FileMode.Open, FileAccess.Read);
            bReader    = new BinaryReader(fileStream);
            Image      = bReader.ReadBytes((int)fileStream.Length);
            bReader.Close();
            fileStream.Close();

            string q1 = "insert into tbl_bugs (bugId,projectname, classname, method, lineNo, endline, errorsnap,author, year, month, day, sourcecode, status, addedby)" +
                        "values ('" + bugs.BugId + "','" + bugs.Projectname + "', '" + bugs.Classname + "', '" + bugs.Method + "', '" + bugs.Lineno + "','" + bugs.Endline + "',@errorsnap,'" + bugs.Author + "', '" + bugs.Year + "', '" + bugs.Month + "', '" + bugs.Day + "', '" + bugs.Sourcecode + "','" + bugs.Status + "', '" + bugs.Addedby + "');";

            try
            {
                conn.Open();
                cmd = new MySqlCommand(q1, conn);
                cmd.Parameters.AddWithValue("errorsnap", Image);
                int addbugs = cmd.ExecuteNonQuery();
                if (addbugs > 0)
                {
                    add = true;
                }
                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error.." + ex.Message);
            }
            return(add);
        }
        public void LeftJoinUsingDefaultIfEmptyToFetchCustomersWithoutAnOrderTest()
        {
            const int maxNumberOfItemsToReturn = 5;
            var       leftJoinUsingDefaultIfEmptyToFetchCustomersWithoutAnOrder = Bugs.LeftJoinUsingDefaultIfEmptyToFetchCustomersWithoutAnOrder(maxNumberOfItemsToReturn);

            Assert.AreEqual(maxNumberOfItemsToReturn, leftJoinUsingDefaultIfEmptyToFetchCustomersWithoutAnOrder.Count());
        }
        public virtual bugCollection GetBugs(int[] bugIDs)
        {
            var bugCollection = new bugCollection();

            bugCollection.AddRange(Bugs.Distinct(new BugComparer()).Where(x => bugIDs.Contains(int.Parse(x.bug_id))).Select(x => x).ToArray());
            return(bugCollection);
        }
Example #20
0
        public Bugs ExportTomodel()
        {
            try
            {
                Bugs ap = new Bugs();
                ap.Description = Description;
                ap.EditedAt    = EditedAt;
                ap.Id          = Id;
                ap.Name        = Name;
                ap.ReporedAt   = ReporedAt;
                if (EditedBy != null)
                {
                    ap.EditedBy = EditedBy.Id;
                }
                if (ReportedBy != null)
                {
                    ap.ReportedBy = ReportedBy.Id;
                }
                if (Project != null)
                {
                    ap.Project = Project;
                }
                this.RowVersion = RowVersion;



                return(ap);
            }
            catch (Exception ex)
            {
                CommonTools.ErrorReporting(ex);
                return(null);
            }
        }
Example #21
0
 public void ImportFromModel(Bugs md)
 {
     try
     {
         if (md != null && CommonTools.isEmpty(md.ReportedBy) == false &&
             CommonTools.isEmpty(md.EditedBy) == false)
         {
             ApplicationUser user   = CommonTools.usrmng.GetUserbyID(md.ReportedBy);
             ApplicationUser eduser = CommonTools.usrmng.GetUserbyID(md.EditedBy);
             if (user != null && eduser != null)
             {
                 this.Id   = md.Id;
                 this.Name = md.Name;
                 if (md.Project != null)
                 {
                     this.Project = md.Project;
                 }
                 this.ReporedAt   = md.ReporedAt;
                 this.ReportedBy  = user;
                 this.RowVersion  = md.RowVersion;
                 this.EditedBy    = eduser;
                 this.Description = md.Description;
             }
         }
     }
     catch (Exception ex)
     {
         CommonTools.ErrorReporting(ex);
     }
 }
Example #22
0
        private void FormBugSubmission_Load(object sender, EventArgs e)
        {
            try {
                RegistrationKey key = RegistrationKeys.GetByKey(_subCur.RegKey);
                _patCur = Patients.GetPat(key.PatNum);
            }
            catch (Exception ex) {
                ex.DoNothing();
                _patCur = new Patient();              //Just in case, needed mostly for debug.
            }
            labelName.Text     = _patCur?.GetNameLF() ?? "";
            labelDateTime.Text = POut.DateT(_subCur.SubmissionDateTime);
            labelVersion.Text  = _subCur.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0");
            labelHashNum.Text  = POut.Long(_subCur.BugSubmissionHashNum);
            if (_subCur.BugId != 0)           //Already associated to a bug
            {
                _bug = Bugs.GetOne(_subCur.BugId);
                butAddViewBug.Text = "View Bug";
            }
            if (_bug != null)
            {
                _listLinks = JobLinks.GetForType(JobLinkType.Bug, _bug.BugId);
                if (_listLinks.Count == 1)
                {
                    butAddViewJob.Text = "View Job";
                }
            }
            Dictionary <string, Patient> dictPats = new Dictionary <string, Patient>();

            dictPats.Add(_subCur.RegKey, _patCur);
            bugSubmissionControl.RefreshData(dictPats, -1, null);          //New selelction, refresh control data.
            bugSubmissionControl.RefreshView(_subCur);
        }
        public async Task <ActionResult <Bugs> > PostBugs(Bugs bugs)
        {
            _context.Bugs.Add(bugs);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBugs", new { id = bugs.Id }, bugs));
        }
Example #24
0
        public async Task <IActionResult> PutBugs(int id, Bugs bugs)
        {
            if (id != bugs.Id)
            {
                return(BadRequest());
            }

            _context.Entry(bugs).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BugsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #25
0
        ///<summary>Returns the commit message for this job. Job should not be null.</summary>
        private string GetCommitMessage(Job job)
        {
            string description;

            if (job.Category == JobCategory.Bug)
            {
                Bug    bug            = Bugs.GetOne(job.ListJobLinks.Where(x => x.LinkType == JobLinkType.Bug).FirstOrDefault()?.FKey ?? 0);
                string bugDescription = "";
                if (bug != null)
                {
                    bugDescription = bug.Description.Replace("\"", "");
                }
                else
                {
                    bugDescription = job.Title;
                }
                description = job.Category.ToString().Substring(0, 1) + job.JobNum + " - "
                              + bugDescription;
            }
            else
            {
                description = job.Category.ToString().Substring(0, 1) + job.JobNum + " - " + job.Title;
            }
            string reviewers = string.Join(", ", job.ListJobReviews
                                           .Where(x => x.ReviewStatus == JobReviewStatus.Done || x.ReviewStatus == JobReviewStatus.NeedsAdditionalReview)
                                           .DistinctBy(x => x.ReviewerNum)
                                           .Select(x => Userods.GetName(x.ReviewerNum))
                                           .OrderBy(x => x)
                                           .ToList());

            return($"{POut.String(description)}\r\nBackported to: {POut.String(job.JobVersion)}\r\nReviewed by: {POut.String(reviewers)}");
        }
Example #26
0
        public int CreateWorkItem(Dictionary <string, string> values)
        {
            if (ThrowOnCreateBug != null)
            {
                throw ThrowOnCreateBug;
            }

            Logger.InfoFormat("Creating bug:");

            // Generate a random ID
            int id;

            do
            {
                id = _rand.Next(1, int.MaxValue);
            } while (Bugs.ContainsKey(id));

            // Apply defaults
            ApplyDefault(values, "ID", id.ToString());
            ApplyDefault(values, "Title", $"WorkItem {id}");
            ApplyDefault(values, "Assigned To", "Owner");
            ApplyDefault(values, "State", "New");

            Bugs[id] = new Dictionary <string, string>(values);

            CacheWorkItem(id);

            return(id);
        }
Example #27
0
 private void FormBugEdit_Load(object sender, EventArgs e)
 {
     if (BugCur == null)
     {
         MsgBox.Show(this, "An invalid bug was attempted to be loaded.");
         DialogResult = DialogResult.Abort;
         Close();
         return;
     }
     textBugId.Text         = BugCur.BugId.ToString();
     textCreationDate.Text  = BugCur.CreationDate.ToString();
     comboStatus.Text       = BugCur.Status_.ToString();
     comboPriority.Text     = BugCur.PriorityLevel.ToString();
     textVersionsFound.Text = BugCur.VersionsFound;
     textVersionsFixed.Text = BugCur.VersionsFixed;
     textDescription.Text   = BugCur.Description;
     textLongDesc.Text      = BugCur.LongDesc;
     textPrivateDesc.Text   = BugCur.PrivateDesc;
     textDiscussion.Text    = BugCur.Discussion;
     textSubmitter.Text     = Bugs.GetSubmitterName(BugCur.Submitter);
     if (!IsNew)
     {
         _listBugSubs.AddRange(BugSubmissions.GetForBugId(BugCur.BugId));
     }
     FillGrid();
 }
        public ActionResult Edit([Bind("Id,ProjectId,BugPriorityId,BugStatusId,BugCreatedBy,BugCreatedOn,BugClosedBy,BugClosedOn,BugResolutionSummary,Document")] BugsEditViewModel model)
        {
            Bugs bug = bugRepository.GetBugs(model.Id);

            try
            {
                if (ModelState.IsValid)
                {
                    bug.ProjectId            = model.ProjectId;
                    bug.BugStatusId          = model.BugStatusId;
                    bug.BugPriorityId        = model.BugPriorityId;
                    bug.BugCreatedBy         = model.BugCreatedBy;
                    bug.BugCreatedOn         = model.BugCreatedOn;
                    bug.BugClosedBy          = model.BugClosedBy;
                    bug.BugClosedOn          = model.BugClosedOn;
                    bug.BugResolutionSummary = model.BugResolutionSummary;

                    if (model.Document != null)
                    {
                        bug.Attachment = ProcessUploadedDocument(model); //Upload document to server
                    }


                    bugRepository.Update(bug);
                    return(RedirectToAction(nameof(Index)));
                }
            }
            catch
            {
                return(NotFound());
            }
            return(View());
        }
Example #29
0
 ///<summary>Reloads all data for form.</summary>
 private void RefreshData()
 {
     _listHashes           = BugSubmissionHashes.GetMany(datePicker.GetDateTimeFrom(), datePicker.GetDateTimeTo());
     _dictBugSubsByHashNum = BugSubmissions.GetForHashNums(_listHashes.Select(x => x.BugSubmissionHashNum).ToList());
     _dictBugs             = Bugs.GetMany(_listHashes.Select(x => x.BugId).Where(x => x != 0).ToList()).ToDictionary(key => key.BugId);
     _dictPatients         = RegistrationKeys.GetPatientsByKeys(_dictBugSubsByHashNum.Values.SelectMany(x => x.Select(y => y.RegKey)).ToList());
 }
        //button event to delete data
        private void button2_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count != 0)
            {
                DialogResult result = MessageBox.Show("Are you sure you want to delete bug record", "Delete", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    int    bugId   = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value);
                    string addedby = dataGridView1.SelectedRows[0].Cells[13].Value.ToString();

                    Bugs bugs = new Bugs();
                    bugs.BugId = bugId;
                    BugsController bController = new BugsController();
                    Boolean        delete      = bController.DeleteBugs(bugs);
                    if (delete)
                    {
                        MessageBox.Show("Deleted Succesfully");
                        dataGridView1.Refresh();
                        LoadBugs();
                    }
                    else
                    {
                        MessageBox.Show("delete unsuccesfull");
                    }
                }
            }
            else
            {
                MessageBox.Show("Please select a row");;
            }
        }
Example #31
0
 public static void TerminateOnInternalBug(Bugs bug_id, string err)
 {
     ShowError("Internal bug " + Enum.GetName(typeof(Bugs), bug_id) +
         ". " + err + ". Terminating application");
     Environment.Exit((int) bug_id);
 }