public void Delete(Int32 id, int curentUserId, string curentUserIp, string curentPageName) { this.ID = id; //удаление привязанных за¤вок var profileForDelete = new UsersProfiles() { ID = id }; profileForDelete.GetById(); var userTickets = new Tickets() { UserProfileID = profileForDelete.ID }; var userTicketsList = userTickets.GetAllItemsByUserProfileID(); foreach (DataRow row in userTicketsList.Tables[0].Rows) { var userTicketsToDelete = new Tickets(); userTicketsToDelete.Delete(Convert.ToInt32(row["ID"]), curentUserId, curentUserIp, curentPageName, row["FullSecureID"].ToString()); } DM.DeleteData(this, curentUserId, curentUserIp, curentPageName); }
public void Delete(Int32 id) { this.ID = id; //удаление прив¤занных за¤вок var profileForDelete = new UsersProfiles() { ID = id }; profileForDelete.GetById(); var userTickets = new Tickets() { UserProfileID = profileForDelete.ID }; var userTicketsList = userTickets.GetAllItemsByUserProfileID(); foreach (DataRow row in userTicketsList.Tables[0].Rows) { var userTicketsToDelete = new Tickets(); userTicketsToDelete.Delete(Convert.ToInt32(row["ID"])); } DM.DeleteData(this); }