Esempio n. 1
0
        private void post_comment(int status)
        {
            try
            {
                //if(validate())
                //{
                    if (update_ticket(status))
                    {
                        var ticket_data = CrmData.get_ticket_details(_ticketID);

                        if (status==6)
                        {
                            Notification.AddToRole(11, "Approve Ticket: " + ticket_data.subject, PetraERP.Shared.Constants.JOB_TYPE_TICKET, ticket_data.id);
                        }
                        if (txtComment.Text != "")
                        {
                            ticket_comment newComment = new ticket_comment();
                            newComment.ticket_id = _ticketID;
                            newComment.comment_date = DateTime.Now;
                            newComment.status = "1".ToString();
                            newComment.owner = AppData.CurrentUser.id;
                            newComment.comment = txtComment.Text;
                            Database.CRM.ticket_comments.InsertOnSubmit(newComment);
                            Database.CRM.SubmitChanges();
                            load_ticket_comments();


                            if (ticket_data.assigned_to != AppData.CurrentUser.id)
                            {
                                Notification.Add(ticket_data.assigned_to, "Comment on Ticket: " + ticket_data.subject, PetraERP.Shared.Constants.JOB_TYPE_TICKET, ticket_data.id);
                            }
                        }
                    }
                    else
                    { MessageBox.Show("Your comment was not posted."); }
                //}
            }
            catch(Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 2
0
 partial void Deleteticket_comment(ticket_comment instance);
Esempio n. 3
0
 partial void Insertticket_comment(ticket_comment instance);
Esempio n. 4
0
 partial void Updateticket_comment(ticket_comment instance);
Esempio n. 5
0
 private void post_comment(int status)
 {
     try
     {
         if(validate())
         {
             if (update_ticket(status))
             {
                 ticket_comment newComment = new ticket_comment();
                 newComment.ticket_id = _ticketID;
                 newComment.comment_date = DateTime.Now;
                 newComment.status = "1".ToString();
                 newComment.owner = AppData.CurrentUser.id;
                 newComment.comment = txtComment.Text;
                 Database.CRM.ticket_comments.InsertOnSubmit(newComment);
                 Database.CRM.SubmitChanges();
                 load_ticket_comments();
             }
             else
             { MessageBox.Show("Your comment was not posted."); }
         }
     }
     catch(Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }