示例#1
0
 partial void Deletetbl_Tickets(tbl_Tickets instance);
示例#2
0
 partial void Inserttbl_Tickets(tbl_Tickets instance);
示例#3
0
 partial void Updatetbl_Tickets(tbl_Tickets instance);
示例#4
0
		private void detach_tbl_Tickets1(tbl_Tickets entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Users1 = null;
		}
示例#5
0
		private void attach_tbl_Tickets(tbl_Tickets entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Users = this;
		}
示例#6
0
		private void detach_tbl_Tickets(tbl_Tickets entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Categories = null;
		}
示例#7
0
        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;
        }
示例#8
0
        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;
        }