Beispiel #1
0
 private bool save_ticket()
 {
     try
     {
         ticket newTicket = new ticket();
         newTicket.ticket_id = txtTicketID.Text;
         newTicket.customer_id = txtPetraID.Text;
         if (isCompany) { newTicket.customer_id_type = 1; } else { newTicket.customer_id_type = 0; }
         newTicket.ticket_priority = get_priority();
         newTicket.subject = txtTicketSubject.Text;
         newTicket.category_id = int.Parse(cmbTicketCategory.SelectedValue.ToString());
         newTicket.correspondence_id = int.Parse(cmbTicketCorrespondence.SelectedValue.ToString());
         newTicket.sub_correspondence_id = int.Parse(cmbTicketSubCorrespondence.SelectedValue.ToString());
         newTicket.notes = txtNotes.Text;
         newTicket.ticket_month = DateTime.Now.Month;
         newTicket.ticket_year = DateTime.Now.Year;
         newTicket.status = 1;
         newTicket.owner = 0;
         newTicket.assigned_to = 1;
         newTicket.created_at = DateTime.Now;
         Database.CRM.tickets.InsertOnSubmit(newTicket);
         Database.CRM.SubmitChanges();
         return true;
     }
     catch (Exception newSlaError)
     {
         MessageBox.Show(newSlaError.Message);
         return false;
     }
 }
        private bool save_ticket()
        {
            try
            {
                ticket newTicket = new ticket();
                newTicket.ticket_id = txtTicketID.Text;
                newTicket.customer_id = txtPetraID.Text;
                if (isCompany) { newTicket.customer_id_type = 1; } else { newTicket.customer_id_type = 0; }
                newTicket.ticket_priority = get_priority();
                newTicket.subject = txtTicketSubject.Text;
                newTicket.category_id = int.Parse(cmbTicketCategory.SelectedValue.ToString());
                newTicket.correspondence_id = int.Parse(cmbTicketCorrespondence.SelectedValue.ToString());
                newTicket.sub_correspondence_id = int.Parse(cmbTicketSubCorrespondence.SelectedValue.ToString());
                newTicket.contact_no = txtTicketContactNo.Text;
                newTicket.email = cmbContactMode.SelectedValue.ToString();
                newTicket.notes = txtNotes.Text;
                newTicket.ticket_month = DateTime.Now.Month;
                newTicket.ticket_year = DateTime.Now.Year;
                newTicket.status = 1;
                newTicket.owner = Users.GetCurrentUser().id;
                newTicket.assigned_to = int.Parse(cmbAssignTo.SelectedValue.ToString());
                newTicket.created_at = DateTime.Now;
                Database.CRM.tickets.InsertOnSubmit(newTicket);
                Database.CRM.SubmitChanges();

                string t = string.Format("Ticket Added: {0}",newTicket.subject);
                
                Notification.Add((int)newTicket.assigned_to, t, PetraERP.Shared.Constants.JOB_TYPE_TICKET, newTicket.id);

                return true;
            }
            catch (Exception newSlaError)
            {
                MessageBox.Show(newSlaError.Message);
                return false;
            }
        }
Beispiel #3
0
 partial void Deleteticket(ticket instance);
Beispiel #4
0
		private void detach_tickets(ticket entity)
		{
			this.SendPropertyChanging();
			entity.correspondence = null;
		}
Beispiel #5
0
 partial void Updateticket(ticket instance);
Beispiel #6
0
 partial void Insertticket(ticket instance);
Beispiel #7
0
		private void detach_tickets(ticket entity)
		{
			this.SendPropertyChanging();
			entity.category = null;
		}
Beispiel #8
0
		private void attach_tickets(ticket entity)
		{
			this.SendPropertyChanging();
			entity.category = this;
		}
Beispiel #9
0
		private void detach_tickets(ticket entity)
		{
			this.SendPropertyChanging();
			entity.ticket_statuse = null;
		}