Пример #1
0
 public Return(DtoCard dtoCard, DtoBook dtoBook, DtoIssue dtoIssue)
 {
     InitializeComponent();
     this.dtoCard  = dtoCard;
     this.dtoBook  = dtoBook;
     this.dtoIssue = dtoIssue;
 }
        private void CreateTaskButton_Click(object sender, RoutedEventArgs e)
        {
            // Test.
            //List<DtoIssue> issues = _integrationBase.ApiCore.Issues.GetProjectDtoIssues(_integrationBase.CurrentProject.Id).OrderBy(i => i.ShortId).ToList();
            //DtoIssue lastIssue = issues.LastOrDefault();
            //if (lastIssue != null)
            //    _integrationBase.ApiCore.Issues.DeleteIssue(lastIssue.Id);

            DtoIssue newIssue = new DtoIssue {
                Name = "New task"
            };

            newIssue = _integrationBase.ApiCore.Projects.PostDtoIssue(_integrationBase.CurrentProject.Id, newIssue);
            Debug.WriteLine(string.Format("ShortId{0}", newIssue.ShortId));

            if (newIssue != null && newIssue.Id != Guid.Empty)
            {
                BimPlusEventArgs args = new BimPlusEventArgs {
                    Id = newIssue.Id
                };
                _integrationBase.EventHandlerCore.OnCreateIssue(args);
                _integrationBase.EventHandlerCore.OnIssueSelected(args);

                _detailsControl.NavigateToIssue(newIssue.Id);
            }
        }
        public CreateSimpleIssueConfiguration()
        {
            CreateRedmineIssueUrl      = System.Environment.GetEnvironmentVariable(_environconfiguredProject);
            CreateRedmineIssueEndPoint = System.Environment.GetEnvironmentVariable(_environCreateRedmineIssueEndPoint);
            // Deserialize configured project from the system variable. This will fill in all the necessary redmine ids to push to the configured project
            var configured = System.Environment.GetEnvironmentVariable(_environconfiguredProject);

            if (String.IsNullOrWhiteSpace(configured))
            {
                throw new Exception("No Configured Project Found");
            }

            ConfiguredProject = DtoIssue.FromJson(configured);
        }
Пример #4
0
 private void ReturnDetails_Load(object sender, EventArgs e)
 {
     dtoIssue              = bllIssue.GetByID(dtoReturn.IssueID);
     dtoBook               = bllBook.GetByID(dtoIssue.BookID);
     txtReturnID.Text      = dtoReturn.ReturnID;
     txtCardID.Text        = dtoCard.CardID;
     txtStaffID.Text       = Session.StaffWorking.StaffID;
     txtStaffName.Text     = Session.StaffWorking.StaffName;
     txtBookID.Text        = dtoBook.BookID;
     txtBookName.Text      = dtoBook.BookName;
     txtAuthorName.Text    = dtoBook.AuthorName;
     txtPublisherName.Text = dtoBook.PublisherName;
     txtISBN.Text          = dtoBook.ISBN;
     txtIssueDate.Text     = dtoIssue.IssueDate.ToString("dd / MM / yyyy");
     txtReturnDate.Text    = dtoReturn.ReturnDate.ToString("dd / MM / yyyy");
 }
        private void OnIssueSelected(BimPlusEventArgs e)
        {
            DtoIssue task = _integrationBase.ApiCore.Issues.GetDtoIssue(e.Id);

            CurrentIssue = task;

            if (_listControl != null)
            {
                _listControl.SetCurrentIssue(e.Id.ToString());
            }

            if (task.Id != Guid.Empty)
            {
                List <Guid> guids = new List <Guid>();

                string scene = task.Scene;

                if (scene != null && scene != "null")
                {
                    DtoScene dtoScene = JsonConvert.DeserializeObject(scene, typeof(DtoScene)) as DtoScene;
                    if (dtoScene != null && dtoScene.Objects != null)
                    {
                        if (dtoScene.Objects.Selected != null)
                        {
                            guids.AddRange(dtoScene.Objects.Selected);
                        }
                        if (dtoScene.Objects.HighlightedSelected != null)
                        {
                            guids.AddRange(dtoScene.Objects.HighlightedSelected);
                        }

                        guids = guids.ToLookup(g => g).Select(l => l.Key).ToList();

                        if (guids != null && guids.Count > 0)
                        {
                            _webViewer.HighlightObjectsByID(guids);

                            BimPlusEventArgs args = new BimPlusEventArgs {
                                Id = guids[0]
                            };
                            _integrationBase.EventHandlerCore.OnObjectSelected(args);
                        }
                    }
                }
            }
        }
Пример #6
0
        private void DgwIssueBook_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgwIssueBook.Rows.Count.Equals(0))
            {
                return;
            }
            string issueID = dgwIssueBook.CurrentRow.Cells["IssueID"].Value.ToString();

            dtoIssue                 = bllIssue.GetByID(issueID);
            txtIssueID.Text          = dtoIssue.IssueID;
            txtLendingStaffID.Text   = dtoIssue.StaffID;
            dtoLendingStaff          = bllStaff.GetByID(dtoIssue.StaffID);
            txtLendingStaffName.Text = dtoLendingStaff.StaffName;
            txtIssueBookDate.Text    = dtoIssue.IssueDate.ToString("dd / MM / yyyy");
            txtIssueNotes.Text       = dtoIssue.Notes;
            //
            btnReturn.Enabled = true;
            btnLost.Enabled   = true;
        }
Пример #7
0
 public bool Add(DtoIssue dtoIssue)
 {
     using (SqlConnection sqlConnection = data.GetConnect()) {
         try {
             sqlConnection.Open();
             string     sql        = @"INSERT INTO ISSUE VALUES(@IssueID, @CardID, @StaffID, @BookID, @IssueDate, @Notes)";
             SqlCommand sqlCommand = new SqlCommand(sql, sqlConnection);
             sqlCommand.Parameters.Add("@IssueID", SqlDbType.NChar).Value  = dtoIssue.IssueID;
             sqlCommand.Parameters.Add("@CardID", SqlDbType.NChar).Value   = dtoIssue.CardID;
             sqlCommand.Parameters.Add("@StaffID", SqlDbType.NChar).Value  = dtoIssue.StaffID;
             sqlCommand.Parameters.Add("@BookID", SqlDbType.NChar).Value   = dtoIssue.BookID;
             sqlCommand.Parameters.Add("@IssueDate", SqlDbType.Date).Value = dtoIssue.IssueDate;
             sqlCommand.Parameters.Add("@Notes", SqlDbType.NVarChar).Value = dtoIssue.Notes;
             sqlCommand.ExecuteNonQuery();
         }
         catch {
             return(false);
         }
     }
     return(true);
 }
Пример #8
0
 public bool Add(DtoIssue dtoIssue)
 {
     return(dalIssue.Add(dtoIssue));
 }