本文整理汇总了C#中Registration.Reserve方法的典型用法代码示例。如果您正苦于以下问题:C# Registration.Reserve方法的具体用法?C# Registration.Reserve怎么用?C# Registration.Reserve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration.Reserve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSelectTimeSlot_Click
protected void btnSelectTimeSlot_Click(object sender, EventArgs e)
{
cvSelectTimeSlotUnavailable.IsValid = true;
cvSelectTimeSlotError.IsValid = true;
try
{
//check if we have a valid club selected
Boolean blnTimeSuccessfullySelected = clubFindSelect.SelectedIndex != 0;
if (blnTimeSuccessfullySelected == true && Session["sess_Transaction"] != null)
{
//load transaction
transaction = (Transaction)Session["sess_Transaction"];
//selected wave
DateTime selectedWaveDateTime = Convert.ToDateTime(drpRaceDate.SelectedValue.Trim() + " " + drpTimeSlot.SelectedValue.Trim() + ":00", System.Globalization.CultureInfo.CreateSpecificCulture("en-GB"));
//set transaction
foreach (Wave wave in transaction.Waves)
{
if (wave.GunTime == selectedWaveDateTime)
{
//assign wave to subscriber
transaction.Subscriber = new Athlete();
transaction.Subscriber.Wave = wave;
//assign race
transaction.Subscriber.Race = wave.Race;
Registration vs = new Registration();
//Add Authentication
//vs.PreAuthenticate = true;
//NetworkCredential myCred = new NetworkCredential("VARegistration", "cr34m t34");
//CredentialCache myCache = new CredentialCache();
//myCache.Add(new Uri(vs.Url), "Basic", myCred);
//vs.Credentials = myCache;
//New code added - alternate way of passing user credentials
vs.UserCredentialsValue = getCredentails();
transaction = vs.GetAvailability(transaction);
if (transaction.Status == TransactionStatus.OK)
{
transaction = vs.Reserve(transaction);
if (transaction.Status == TransactionStatus.OK)
{
Session["sess_Transaction"] = transaction;
//Update Page
string classNames;
classNames = pnlStep3.Attributes["class"];
pnlStep3.Attributes.Add("class", classNames.Replace(" hidden", ""));
classNames = pnlStep4.Attributes["class"];
pnlStep4.Attributes.Add("class", classNames.Replace(" hidden", ""));
classNames = pnlStep5.Attributes["class"];
pnlStep5.Attributes.Add("class", classNames.Replace(" hidden", ""));
classNames = pnlStep6.Attributes["class"];
pnlStep6.Attributes.Add("class", classNames.Replace(" hidden", ""));
classNames = timeWarning.Attributes["class"];
timeWarning.Attributes.Add("class", classNames.Replace(" hidden", ""));
////Test
//Athlete subscriber = transaction.Subscriber;
//subscriber.IsTeam = true;
//subscriber.Type = AthleteType.Member;
//subscriber.Firstname = "MyName";
//subscriber.Lastname = "MySurname";
//subscriber.Dob = Convert.ToDateTime("12/12/1980", System.Globalization.CultureInfo.CreateSpecificCulture("en-GB"));
//subscriber.Gender = AthleteGender.Male;
//subscriber.Address1 = "MyAddress1";
//subscriber.Address2 = "MyAddress2";
//subscriber.City = "MyAddress3";
//subscriber.Postcode = "sw11 1hh";
//subscriber.Phone = "0123412341234";
//subscriber.Email = "[email protected]";
////Add Team Details
////Team name
//subscriber.Team = "My Team";
////Add user 1
//subscriber.Firstname2 = "MyTeamMateName";
//subscriber.Lastname2 = "MyTeamMateSurname";
//subscriber.Dob2 = Convert.ToDateTime("12/12/1978", System.Globalization.CultureInfo.CreateSpecificCulture("en-GB"));
//subscriber.Gender2 = AthleteGender.Male;
////Add Next Of Kin
//.........这里部分代码省略.........