void HandleListOfSubsDoubleClick(object sender, EventArgs e) { if (ListOfSubs.SelectedItem != null && GetMarketByGUID != null) { TransactionSubmission Submission = (TransactionSubmission)ListOfSubs.SelectedItem; string SelectedGUID = Submission.ProjectGUID; string SelectedMarketGuid = Submission.MarketGuid; Market market = GetMarketByGUID(SelectedMarketGuid); if (null != market) { // We open the AddEdit Submission Panel if (SelectedGUID != Constants.BLANK && SelectedMarketGuid != Constants.BLANK) { //string ProjectName = CurrentProject.Text; // LayoutDetails.Instance.TransactionsList.AddEvent (new TransactionSubmission // (DateTime.Now, SelectedGUID, SelectedMarketGuid, 0, 0.0f, 0.0f, // DateTime.Now, "Some Note", "no rights", "first draft", "Invalid", "No feedback", "Submission", SelectedMarket)); // string MarketDetails = String.Format("{0} {1} {2}", SelectedMarket, MarketEdit.CurrentMarketType, MarketEdit.CurrentMarketPrint); AddEditSubmissionsForm AddForm = new AddEditSubmissionsForm (true); int words = MasterOfLayouts.GetWordsFromGuid (SelectedGUID); //Use this only on AN edit AddForm.SubEditPanel.LoadFromExisting(Submission); AddForm.SubEditPanel.SubmissionSelected (market, words); if (AddForm.ShowDialog () == DialogResult.OK) { TransactionSubmission EditedSub = new TransactionSubmission( AddForm.SubEditPanel.DateSubmitted, SelectedGUID, SelectedMarketGuid, AddForm.SubEditPanel.Priority, AddForm.SubEditPanel.Expenses, AddForm.SubEditPanel.Earned, AddForm.SubEditPanel.DateReplied, AddForm.SubEditPanel.Note, AddForm.SubEditPanel.Rights, AddForm.SubEditPanel.Draft, AddForm.SubEditPanel.ReplyType, AddForm.SubEditPanel.ReplyFeedback, AddForm.SubEditPanel.SubmissionTypeType, Submission.MarketName); EditedSub.SetID(Submission.ID); LayoutDetails.Instance.TransactionsList.UpdateEvent(EditedSub); // need to rebuild the list otherwise // we end up wit hthe old transactions BuildList (); UpdateDoTheyLikeMe(ProjectGUID); // LayoutDetails.Instance.TransactionsList.AddEvent (new TransactionSubmission // (AddForm.SubEditPanel.DateSubmitted, // SelectedGUID, // SelectedMarketGuid, // AddForm.SubEditPanel.Priority, // AddForm.SubEditPanel.Expenses, // AddForm.SubEditPanel.Earned, // AddForm.SubEditPanel.DateReplied, // AddForm.SubEditPanel.Note, // AddForm.SubEditPanel.Rights, // AddForm.SubEditPanel.Draft, // AddForm.SubEditPanel.ReplyType, // AddForm.SubEditPanel.ReplyFeedback, // AddForm.SubEditPanel.SubmissionTypeType, SelectedMarket)); } //NewMessage.Show (Loc.Instance.GetString ("Submission Added.")); } else { NewMessage.Show (Loc.Instance.GetString ("Either the market or project were not selected, or were invalid.")); } } else { NewMessage.Show (Loc.Instance.GetStringFmt("Was unable to find the market with the GUID {0}", SelectedMarketGuid)); } } }
private void AddSubmissionToProject() { if (SelectedGUID != Constants.BLANK && SelectedMarketGuid != Constants.BLANK) { //string ProjectName = CurrentProject.Text; // LayoutDetails.Instance.TransactionsList.AddEvent (new TransactionSubmission // (DateTime.Now, SelectedGUID, SelectedMarketGuid, 0, 0.0f, 0.0f, // DateTime.Now, "Some Note", "no rights", "first draft", "Invalid", "No feedback", "Submission", SelectedMarket)); // string MarketDetails = String.Format("{0} {1} {2}", SelectedMarket, MarketEdit.CurrentMarketType, MarketEdit.CurrentMarketPrint); AddSubmission.Text = Loc.Instance.GetStringFmt ("Submit {0} to {1}", DefaultProjectLabel,SelectedMarket); AddEditSubmissionsForm AddForm = new AddEditSubmissionsForm(true); int words = MasterOfLayouts.GetWordsFromGuid(SelectedGUID); AddForm.SubEditPanel.SubmissionSelected(MarketEdit.SelectedMarketAsObject(), words); // Use this only on AN editAddForm.SubEditPanel.LoadFromExisting(); if (AddForm.ShowDialog() == DialogResult.OK) { LayoutDetails.Instance.TransactionsList.AddEvent (new TransactionSubmission (AddForm.SubEditPanel.DateSubmitted, SelectedGUID, SelectedMarketGuid, AddForm.SubEditPanel.Priority, AddForm.SubEditPanel.Expenses, AddForm.SubEditPanel.Earned, AddForm.SubEditPanel.DateReplied, AddForm.SubEditPanel.Note, AddForm.SubEditPanel.Rights, AddForm.SubEditPanel.Draft, AddForm.SubEditPanel.ReplyType, AddForm.SubEditPanel.ReplyFeedback, AddForm.SubEditPanel.SubmissionTypeType, SelectedMarket)); ViewOfProjectSubmissions.BuildList(); ViewOfProjectSubmissions.UpdateDoTheyLikeMe(SelectedGUID); } //NewMessage.Show (Loc.Instance.GetString ("Submission Added.")); } else { NewMessage.Show (Loc.Instance.GetString ("Either the market or project were not selected, or were invalid.")); } }