partial void Deletetbl_Tickets(tbl_Tickets instance);
partial void Inserttbl_Tickets(tbl_Tickets instance);
partial void Updatetbl_Tickets(tbl_Tickets instance);
private void detach_tbl_Tickets1(tbl_Tickets entity) { this.SendPropertyChanging(); entity.tbl_Users1 = null; }
private void attach_tbl_Tickets(tbl_Tickets entity) { this.SendPropertyChanging(); entity.tbl_Users = this; }
private void detach_tbl_Tickets(tbl_Tickets entity) { this.SendPropertyChanging(); entity.tbl_Categories = null; }
private void AssignDataObjectToEntity(tbl_Tickets dbCategory, ref Ticket entity) { entity.IdTicket = dbCategory.IdTicket; entity.Description = dbCategory.Description; entity.CreatedOn = dbCategory.CreatedOn; entity.AssignedTo = new Security.MembershipService().GetUserById(dbCategory.IdAssignedTo); entity.Category = new CategoryService().GetByID(dbCategory.IdCategory); entity.TicketStatus = dbCategory.TicketStatus == "Abierto" ? Ticket.TicketStatusEnum.Abierto : Ticket.TicketStatusEnum.Cerrado; entity.CreatedBy = new Security.MembershipService().GetUserById(dbCategory.CreatedBy); entity.CloseDescription = dbCategory.CloseDescription; try { entity.ClosedOn = dbCategory.ClosedOn; entity.ClosedOnByUser = dbCategory.ClosedOnByUser.Value; } catch { } entity.IdPrioriy = dbCategory.IdPriority; }
private int Insert(Ticket entTicket) { TCRepositoryDataContext context = DataBaseUtils.GetContext(); try { tbl_Tickets dbTickets = new tbl_Tickets() { CloseDescription = entTicket.CloseDescription, CreatedOn = entTicket.CreatedOn, CreatedBy = entTicket.CreatedBy.IdUser, Description = entTicket.Description, IdAssignedTo = entTicket.AssignedTo.IdUser, IdCategory = entTicket.Category.IdCategory, IdPriority = entTicket.IdPrioriy, TicketStatus = entTicket.TicketStatus.ToString() }; context.tbl_Tickets.InsertOnSubmit(dbTickets); context.SubmitChanges(); return dbTickets.IdTicket; } catch { } return -1; }