static void Main() { var activity1 = new Activity1(); var activity2 = new Activity2(); var activity3 = new Activity3(); WorkflowEngine.Run(activity1, activity2, activity3); }
// GET: BookActivity public ActionResult Index(string title, string largeImageURL, string fromPrice, string fromOriginalPriceValue, string duration, string supplierName) { var viewModel = new Activity2(); viewModel.title = title; viewModel.largeImageURL = largeImageURL; viewModel.fromPrice = fromPrice; viewModel.duration = duration; viewModel.supplierName = supplierName; return(View(viewModel)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); someButton.Click += (sender, args) => { NavigationBridge.FinishedNavigating = activity2 => { Activity2 activity = (Activity2)activity2; // Vuola, you now have a reference to the instance. // Use this reference to set public properties in Activity2, // using data from *this* Activity1 }; var intent = new Intent(this, typeof(Activity2)); this.StartActivity(intent); }; }
public void TestTreeConstructionAndTraversalMethodsOverTreeOfNodeITreeNodeImplementingObjects() { Activity2 alice = new Activity2("Alice"); Activity2 bob = new Activity2("Bob"); Activity2 charlie = new Activity2("Charlie"); Activity2 dingus = new Activity2("Dingus"); Activity2 ethel = new Activity2("Ethel"); Activity2 frank = new Activity2("Frank"); Activity2 george = new Activity2("George"); alice.AddChild(bob); alice.AddChild(charlie); alice.AddChild(dingus); bob.AddChild(ethel); bob.AddChild(frank); bob.AddChild(george); StringBuilder sb = new StringBuilder(); foreach (ITreeNode <Activity2> a in alice.DescendantNodesBreadthFirst(true)) { sb.AppendLine(a.Payload.Name); } foreach (ITreeNode <Activity2> a in alice.DescendantNodesDepthFirst(true)) { sb.AppendLine(a.Payload.Name); } foreach (Activity2 a in alice.DescendantsBreadthFirst(true)) { sb.AppendLine(a.Name); } foreach (Activity2 a in alice.DescendantsDepthFirst(true)) { sb.AppendLine(a.Name); } Console.WriteLine("This test manipulates a tree that holds elements that implement ITreeNode."); Console.WriteLine(sb.ToString()); Console.WriteLine(); Assert.IsTrue(StripCRLF(sb.ToString()).Equals(StripCRLF(REQUIRED_ITERATIONSTRING1))); }
private void PopulateFields(int activityId) { Activity0Helper helper = new Activity0Helper(); Activity0 activity0 = helper.GetActivityData(2, activityId); Activity2 activity = (Activity2)activity0; if (activity != null) { comboBox1.Text = activity.Region; comboBox2.Text = activity.Zone; textBox1.Text = activity.Schoolname; textBox2.Text = activity.Clubname; comboBox3.Text = activity.Woreda; dateTimePicker1.Value = activity.ActivityDate; textBox3.Text = activity.IssuesRaised; textBox4.Text = activity.AgreedActionPoints; textBox7.Text = activity.FacilitatorName; textBox6.Text = activity.Position; } List <Participant> participantsList = helper.GetParticpantData(2, activityId); for (int i = 0; i < participantsList.Count; i++) { Participant participant0 = participantsList[i]; Participant2 participant = (Participant2)participant0; string disabled = "No"; if (participant.Disabled == 0) { disabled = "No"; } else { disabled = "Yes"; } string[] row = { dataGridView2.RowCount + "", participant.Name, participant.Gradelevel, participant.Sex, participant.Age.ToString(), disabled }; dataGridView2.Rows.Add(row); } }
private void SaveData(int saveOrUpdate) { //mainFieldsValid(); if (mainFieldsValid()) { //MessageBox.Show("All fields valid. Ready to submit data to database."); Activity0Helper helper = new Activity0Helper(); Activity2 activity = new Activity2(); //(region, zone, woreda, kebele, activity_date, user_id, facilitator_name, position, localtimestamp, mac) activity.Region = comboBox1.Text; activity.Zone = comboBox2.Text; activity.Woreda = comboBox3.Text; activity.Schoolname = textBox1.Text; activity.Clubname = textBox2.Text; activity.ActivityDate = dateTimePicker1.Value; activity.UserId = Properties.Settings.Default.UID; //change this using property stored id of currently logged in user activity.FacilitatorName = textBox7.Text; //make name of logged in user available in this field activity.Clubleadername = textBox7.Text; activity.Position = textBox6.Text; activity.LocalTimeStamp = DateTime.Now; activity.Mac = StringCipher.GetMacAddress(); activity.IssuesRaised = textBox3.Text; activity.AgreedActionPoints = textBox4.Text; List <Participant> participantsList = new List <Participant>(); if (dataGridView2.RowCount > 1) { string disabled = "no"; for (int i = 0; i < dataGridView2.Rows.Count - 1; i++)//-1 to avoid empty row { Participant2 participant = new Participant2(); if (dataGridView2.Rows[i].Cells[1].Value != null) { participant.Name = dataGridView2.Rows[i].Cells[1].Value.ToString(); } if (dataGridView2.Rows[i].Cells[2].Value != null) { participant.Gradelevel = dataGridView2.Rows[i].Cells[2].Value.ToString(); } if (dataGridView2.Rows[i].Cells[3].Value != null) { participant.Sex = dataGridView2.Rows[i].Cells[3].Value.ToString(); } if (dataGridView2.Rows[i].Cells[4].Value != null) { participant.Age = Convert.ToInt32(dataGridView2.Rows[i].Cells[4].Value.ToString()); } if (dataGridView2.Rows[i].Cells[5].Value != null) { disabled = dataGridView2.Rows[i].Cells[5].Value.ToString().ToLower(); if (disabled.CompareTo("no") == 0) { participant.Disabled = 0; } else { participant.Disabled = 1; } } //participant.Age = 2; participantsList.Add(participant); //MessageBox.Show(dataGridView2.Rows[i].Cells[1].Value.ToString()); } } //MessageBox.Show(activity.Position); int id = helper.Insert(2, activity, participantsList); if (id > 0) { InsertRegionAndKebeleData(); //MessageBox.Show("Activity data added successfully!"); MessageBox.Show("Activity data added successfully!", "Successfully Addition", MessageBoxButtons.OK, MessageBoxIcon.Information); //check internet connection before syncing data if (saveOrUpdate == 1)//update button clicked { //if (StringCipher.CheckInternet("http://" + Session.Properties.Settings.Default.RemoteDatabaseAddress)) SyncData(); } //this.Close(); //or Reset fields this.Close(); } } }