コード例 #1
0
 public TicketView RemoveTicket(TicketModel model)
 {
     foreach (TicketView item in this.Controls)
     {
         if (model.id == item._Model.id)
         {
             this.Controls.Remove(item);
             OnAddorRemoveticket();
             return(item);
         }
     }
     return(null);
 }
コード例 #2
0
 private void Pn_done_OnPanelClick(TicketModel mode)
 {
     pn_done.setColor(mode);
     tb_creater.Text      = mode.creater;
     tb_createdate.Text   = mode.createdate.ToString("HH:mm:ss dd:MM:yyyy");
     tb_donedate.Text     = mode.donedate.ToString("HH:mm:ss dd:MM:yyyy");
     tb_assginer.Text     = mode.assigner;
     tb_status.Text       = lstStatus.Where(s => s.id == mode.status).FirstOrDefault().name;
     tb_name.Text         = mode.name;
     tb_priority.Text     = lstPriority.Where(p => p.id == mode.priority).FirstOrDefault().name;
     tb_related.Text      = lstRelated.Where(r => r.id == mode.related).FirstOrDefault().name;
     rtb_description.Text = mode.description;
     rtb_comment.Text     = mode.reviewdescription;
 }
コード例 #3
0
 public void setColor(TicketModel mode)
 {
     foreach (TicketView item in this.Controls)
     {
         if (item._Model.id == mode.id)
         {
             item.BackColor = Color.FromArgb(236, 135, 14);
         }
         else
         {
             item.BackColor = Color.FromArgb(250, 206, 156);
         }
     }
 }
コード例 #4
0
 private void btn_create_Click(object sender, EventArgs e)
 {
     Ticket = new TicketModel()
     {
         name        = tb_name.Text,
         priority    = (int)((PriorityModel)cb_priority.SelectedItem).id,
         related     = (int)((RelatedModel)cb_related.SelectedItem).id,
         creater     = UserName,
         assigner    = "Unknown",
         status      = 1,
         description = rtb_description.Text
     };
     DialogResult = DialogResult.OK;
 }
コード例 #5
0
        public bool AssginTicket(TicketModel item)
        {
            bool result = false;

            try
            {
                if (controller.AssginTicket(item))
                {
                    lstTickets.Where(t => t.id == item.id).First().assigner = item.assigner;
                    result = true;
                }
            }
            catch (Exception ex)
            {
                LogFile.writeLog(LogFile.DIR, "Exception" + LogFile.getTimeStringNow() + ".txt", LogFile.Filemode.GHIDE, ex.Message);
            }

            return(result);
        }
コード例 #6
0
        public bool removeTicket(TicketModel item)
        {
            bool result = false;

            try
            {
                if (DBHandler.deleteDataBase(ref conn,
                                             "`scrum_ticket`",
                                             "`id` = " + item.id))
                {
                    result = true;
                }
            }
            catch (Exception ex)
            {
                LogFile.writeLog(LogFile.DIR, "Exception" + LogFile.getTimeStringNow() + ".txt", LogFile.Filemode.GHIDE, ex.Message);
            }

            return(result);
        }
コード例 #7
0
        public bool setStatus(TicketView sender, TicketModel item)
        {
            bool result = false;

            try
            {
                if (controller.setStatusTicket(item))
                {
                    int currentStatus = lstTickets.Where(t => t.id == item.id).First().status;
                    setTicket(sender, currentStatus, item.status);
                    lstTickets.Where(t => t.id == item.id).First().status            = item.status;
                    lstTickets.Where(t => t.id == item.id).First().reviewdescription = item.reviewdescription;
                    result = true;
                }
            }
            catch (Exception ex)
            {
                LogFile.writeLog(LogFile.DIR, "Exception" + LogFile.getTimeStringNow() + ".txt", LogFile.Filemode.GHIDE, ex.Message);
            }

            return(result);
        }
コード例 #8
0
        public bool setStatusTicket(TicketModel item)
        {
            bool result = false;

            try
            {
                if (DBHandler.updateDataBase(ref conn,
                                             "`scrum_ticket`",
                                             "`status`= '" + item.status + "', `reviewdescription`= '" + Functions.StringtoUFT8String(item.reviewdescription) + "'" +
                                             ((item.status == 5) ? " ,`donedate` = NOW()" : ""),
                                             "`id` = " + item.id))
                {
                    result = true;
                }
            }
            catch (Exception ex)
            {
                LogFile.writeLog(LogFile.DIR, "Exception" + LogFile.getTimeStringNow() + ".txt", LogFile.Filemode.GHIDE, ex.Message);
            }

            return(result);
        }
コード例 #9
0
        public List <TicketModel> getAllTicketDone()
        {
            List <TicketModel> result = new List <TicketModel>();

            try
            {
                DataTable dt = DBHandler.selectDataBase(ref conn, "`scrum_ticket`", "*", "`status` = 5");
                if (dt != null)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        TicketModel item = new TicketModel()
                        {
                            id                = (long)dt.Rows[i]["id"],
                            name              = (string)dt.Rows[i]["name"],
                            assigner          = (string)dt.Rows[i]["assigner"],
                            creater           = (string)dt.Rows[i]["creater"],
                            description       = Functions.UFT8StringtoString((string)dt.Rows[i]["description"]),
                            priority          = (int)dt.Rows[i]["priority"],
                            related           = (int)dt.Rows[i]["related"],
                            status            = (int)dt.Rows[i]["status"],
                            reviewdescription = Functions.UFT8StringtoString((string)dt.Rows[i]["reviewdescription"]),
                            createdate        = (DateTime)dt.Rows[i]["createdate"],
                            donedate          = (DateTime)dt.Rows[i]["donedate"]
                        };
                        result.Add(item);
                    }
                    result = result.OrderBy(r => r.createdate).ToList();
                }
            }
            catch (Exception ex)
            {
                result = null;
                LogFile.writeLog(LogFile.DIR, "Exception" + LogFile.getTimeStringNow() + ".txt", LogFile.Filemode.GHIDE, ex.Message);
            }

            return(result);
        }
コード例 #10
0
        private void ScrumBoardReviewDone_Load(object sender, EventArgs e)
        {
            Init();

            lstTickets = controller.getAllTicketDone();
            TicketModel fist = null;

            if (lstTickets != null)
            {
                foreach (TicketModel item in lstTickets)
                {
                    pn_done.AddTicket(item);
                    if (fist == null)
                    {
                        fist = item;
                    }
                }
                if (fist != null)
                {
                    Pn_done_OnPanelClick(fist);
                }
            }
        }