本文整理汇总了C#中Registration.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Registration.Save方法的具体用法?C# Registration.Save怎么用?C# Registration.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration.Save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSend_Click
private void btnSend_Click(object sender, EventArgs e)
{
int groupid = -1;
string strLeaderEmail = "";
string strClusterLeaderEmail = "";
foreach (DataGridItem item in dgResults.Items)
{
RadioButton rb = (RadioButton)item.FindControl("rbSelect");
if (rb.Checked)
{
groupid = Int32.Parse(rb.Attributes["groupid"]);
break;
}
}
bool sendClusterLeaderEmail = bool.Parse(SendClusterLeaderEmailSetting);
Group group = new Group(groupid);
strLeaderEmail = group.Leader.Emails.FirstActive;
if (strLeaderEmail.Length == 0 || sendClusterLeaderEmail)
{
GroupCluster parentCluster = group.GroupCluster;
while (parentCluster.GroupClusterID != -1)
{
if (parentCluster.Leader.Emails.FirstActive != string.Empty)
{
strLeaderEmail = (!string.IsNullOrEmpty(strLeaderEmail) ? strLeaderEmail : parentCluster.Leader.Emails.FirstActive);
strClusterLeaderEmail = parentCluster.Leader.Emails.FirstActive;
break;
}
else if (parentCluster.Admin != null && parentCluster.Admin.PersonID != parentCluster.Leader.PersonID && parentCluster.Admin.Emails.FirstActive != string.Empty)
{
strLeaderEmail = (!string.IsNullOrEmpty(strLeaderEmail) ? strLeaderEmail : parentCluster.Admin.Emails.FirstActive);
strClusterLeaderEmail = parentCluster.Admin.Emails.FirstActive;
break;
}
parentCluster = new GroupCluster(parentCluster.ParentClusterID);
}
}
if (strLeaderEmail.Length == 0 && GroupLeaderEmailSetting != string.Empty)
strLeaderEmail = GroupLeaderEmailSetting;
else if (strLeaderEmail.Length == 0)
strLeaderEmail = CurrentOrganization.Settings["GroupLocatorEmail"];
SmallGroupLocator smallGroupLocator = new SmallGroupLocator();
Dictionary<string, string> fields = new Dictionary<string, string>();
fields.Add("##GroupName##", group.Title);
fields.Add("##GroupID##", group.GroupID.ToString());
fields.Add("##Name##", tbName.Text);
fields.Add("##Phone##", tbPhone.PhoneNumber);
fields.Add("##Email##", tbEmail.Text);
fields.Add("##Notes##", tbNotes.Text);
smallGroupLocator.Send(strLeaderEmail, fields);
if (sendClusterLeaderEmail && strLeaderEmail != strClusterLeaderEmail)
smallGroupLocator.Send(strClusterLeaderEmail, fields);
//set pending registratant
if (PendingRegistraintSetting.ToLower() == "true" && CurrentPerson != null && CurrentPerson.PersonID != -1)
{
Registration registration = new Registration();
registration.OrganizationID = CurrentPortal.OrganizationID;
if (_useGroupType)
{
Lookup grpType = group.GroupType;
try
{
registration.ClusterType = new ClusterType(Int32.Parse(grpType.Qualifier));
}
catch
{
throw new ArenaApplicationException(string.Format("Invalid Cluster Type ID for Small Group Type '{0}'", grpType.Value));
}
registration.GroupType = grpType;
}
else
{
registration.ClusterType = group.ClusterType;
registration.GroupType = null;
}
if (group.GroupType.ToString() != string.Empty)
registration.GroupType = group.GroupType;
registration.Notes = tbNotes.Text;
registration.Persons.Add(CurrentPerson);
registration.DayOfWeek.Add(group.MeetingDay);
registration.AgeRange.Add(group.PrimaryAge);
registration.MaritalPreference.Add(group.PrimaryMaritalStatus);
registration.SetCluster();
registration.GroupID = group.GroupID;
registration.Save(CurrentPortal.OrganizationID, CurrentUser.Identity.Name);
}
Response.Redirect(string.Format("~/default.aspx?page={0}", RedirectPageIDSetting.ToString()), true);
}