private void button4_Click(object sender, EventArgs e) { //Create a new dinner... FormDinner oForm = new FormDinner(); if (oForm.ShowDialog(this) == DialogResult.OK) { Guid id = Communications.CommandBus.DinnerCreate(oForm.dtDate.Value.AddHours(Convert.ToInt32(oForm.txtHour.Text)).AddMinutes(Convert.ToInt32(oForm.txtMinute.Text)).AddSeconds(-oForm.dtDate.Value.Second), oForm.txtLocation.Text, oForm.txtDescription.Text, user.User_Id).ARId; MessageBox.Show(id.ToString()); } }
private void button3_Click(object sender, EventArgs e) { foreach (ListViewItem oItem in lvIAmHosting.SelectedItems) { UIClasses.Report_Dinner oDinner = oItem.Tag as UIClasses.Report_Dinner; FormDinner oForm = new FormDinner(); oForm.txtDescription.Text = oDinner.Description; oForm.txtLocation.Text = oDinner.Location; oForm.dtDate.Value = oDinner.Date.Date; oForm.txtHour.Text = oDinner.Date.Hour.ToString(); oForm.txtMinute.Text = oDinner.Date.Minute.ToString(); if (oForm.ShowDialog(this) == DialogResult.OK) { List<NServiceBus.IMessage> oList = new List<NServiceBus.IMessage>(); //What has changed? DateTime dtNew = oForm.dtDate.Value.AddHours(Convert.ToInt32(oForm.txtHour.Text)).AddMinutes(Convert.ToInt32(oForm.txtMinute.Text)).AddSeconds(-oForm.dtDate.Value.Second); if (dtNew != oDinner.Date) oList.Add(new NerdCommandMessages.DinnerModifyTime(oDinner.Dinner_Id, dtNew, CommandInfrastructure.MessageLogInfo.CreateNew(Communications.CommandBus.CurrentUser))); if ( oForm.txtLocation.Text != oDinner.Location ) oList.Add(new NerdCommandMessages.DinnerModifyLocation(oDinner.Dinner_Id, oForm.txtLocation.Text, CommandInfrastructure.MessageLogInfo.CreateNew(Communications.CommandBus.CurrentUser))); if (oForm.txtDescription.Text != oDinner.Description) oList.Add(new NerdCommandMessages.DinnerModifyDescription(oDinner.Dinner_Id, oForm.txtDescription.Text, CommandInfrastructure.MessageLogInfo.CreateNew(Communications.CommandBus.CurrentUser))); Communications.CommandBus.Bus.Send(oList.ToArray()); } } }