public IAProductionOrder DuplicateProductionOrder(IAProductionOrder oIAProductionOrder, int iIAJobID) { var oIAProductionOrderDuplicate = new IAProductionOrder(); oIAProductionOrderDuplicate.IAProductionOrderStatusID = GetProductionOrderStatusID(ProductionOrderStatus.Incomplete); oIAProductionOrderDuplicate.IAJobID = iIAJobID; oIAProductionOrderDuplicate.HasBeenViewedByTalent = false; oIAProductionOrderDuplicate.CompletedDateTime = DateTime.Now; oIAProductionOrderDuplicate.CreatedDateTime = DateTime.Now; oIAProductionOrderDuplicate.ProductionDateTime = DateTime.Now; oIAProductionOrderDuplicate.OnHoldDateTime = DateTime.Now; oIAProductionOrderDuplicate.IATalentTypeID = oIAProductionOrder.IATalentTypeID; oIAProductionOrderDuplicate.MPUserIDTalent = oIAProductionOrder.MPUserIDTalent; oIAProductionOrderDuplicate.MPUserIDProducer = oIAProductionOrder.MPUserIDProducer; oIAProductionOrderDuplicate.MPUserIDOnHold = oIAProductionOrder.MPUserIDOnHold; oIAProductionOrderDuplicate.Notes = string.Empty; DataAccess.IAProductionOrders.InsertOnSubmit(oIAProductionOrderDuplicate); DataAccess.SubmitChanges(); // Duplicate spots and files foreach (var oIASpot in oIAProductionOrder.IASpots) { DuplicateSpot(oIASpot, oIAProductionOrderDuplicate.IAProductionOrderID); } return oIAProductionOrderDuplicate; }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { Session["IAProductionOrderID"] = MemberProtect.Utility.ValidateInteger(Request.QueryString["id"]); } if (Session["IAProductionOrderID"] != null) { m_oIAProductionOrder = DataAccess.IAProductionOrders.SingleOrDefault(row => row.IAProductionOrderID == (int) Session["IAProductionOrderID"]); } if (m_oIAProductionOrder != null) { // Talent should only be able to view PO's that are assigned to themselves if (m_oIAProductionOrder.MPUserIDTalent != MemberProtect.CurrentUser.UserID) { Response.Redirect(GetBackURL()); } // If the Job has been put on hold (withdrawn), then the talent needs to be told that and redirected to their dashboard if (!m_oIAProductionOrder.IAJob.IsSentToProduction) { RedirectMessage("~/talent-dashboard.aspx", "This production order has been put on hold, you will be notified when it is ready.", MessageTone.Neutral); } m_oRepeater.ItemCreated += OnRepeaterItemCreated; m_oRepeater.DataSource = m_oIAProductionOrder.IASpots; m_oRepeater.DataBind(); if (!m_oIAProductionOrder.HasBeenViewedByTalent) { m_oIAProductionOrder.HasBeenViewedByTalent = true; DataAccess.SubmitChanges(); foreach (var oIASpot in m_oIAProductionOrder.IASpots) { oIASpot.IASpotStatusID = ApplicationContext.GetSpotStatusID(SpotStatus.Viewed); DataAccess.SubmitChanges(); } } if (!IsPostBack) { m_txtNotes.Text = m_oIAProductionOrder.Notes; SetupBreadcrumbAndBackButton(); } } else { Response.Redirect(GetBackURL()); } }
public IAProductionOrder DuplicateProductionOrder(IAProductionOrder oIAProductionOrder) { return DuplicateProductionOrder(oIAProductionOrder, oIAProductionOrder.IAJobID); }