protected void ok_Click(object sender, EventArgs e) { if(dojoPromotionID == 0) obj = new DojoPromotion(); else obj = new DojoPromotion(dojoPromotionID); obj.PromotionDate = DateTime.Parse(tbPromotionDate.Text); if(msMember.SelectedItem != null && msMember.SelectedItem.Value != "Null") obj.Member = DojoMember.NewPlaceHolder( int.Parse(msMember.SelectedItem.Value)); else obj.Member = null; if(msTest.SelectedItem != null && msTest.SelectedItem.Value != "Null") obj.Test = DojoTest.NewPlaceHolder( int.Parse(msTest.SelectedItem.Value)); else obj.Test = null; if(msPromotionRank.SelectedItem != null && msPromotionRank.SelectedItem.Value != "Null") obj.PromotionRank = DojoRank.NewPlaceHolder( int.Parse(msPromotionRank.SelectedItem.Value)); else obj.PromotionRank = null; if(msLastRank.SelectedItem != null && msLastRank.SelectedItem.Value != "Null") obj.LastRank = DojoRank.NewPlaceHolder( int.Parse(msLastRank.SelectedItem.Value)); else obj.LastRank = null; if(msStatus.SelectedItem != null && msStatus.SelectedItem.Value != "Null") obj.Status = DojoPromotionStatus.NewPlaceHolder( int.Parse(msStatus.SelectedItem.Value)); else obj.Status = null; if(editOnAdd) dojoPromotionID = obj.Save(); else obj.Save(); if(resetOnAdd) { tbPromotionDate.Text = DateTime.Now.ToString(); msMember.SelectedIndex = 0; msTest.SelectedIndex = 0; msPromotionRank.SelectedIndex = 0; msLastRank.SelectedIndex = 0; msStatus.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
protected void ok_Click(object sender, EventArgs e) { if (dojoBulkAttendanceEntryID == 0) { obj = new DojoBulkAttendanceEntry(); } else { obj = new DojoBulkAttendanceEntry(dojoBulkAttendanceEntryID); } obj.StartDate = DateTime.Parse(tbStartDate.Text); obj.EndDate = DateTime.Parse(tbEndDate.Text); obj.Duration = TimeSpan.Parse(tbDuration.Text); if (msMember.SelectedItem != null && msMember.SelectedItem.Value != "Null") { obj.Member = DojoMember.NewPlaceHolder( int.Parse(msMember.SelectedItem.Value)); } else { obj.Member = null; } if (msRank.SelectedItem != null && msRank.SelectedItem.Value != "Null") { obj.Rank = DojoRank.NewPlaceHolder( int.Parse(msRank.SelectedItem.Value)); } else { obj.Rank = null; } if (editOnAdd) { dojoBulkAttendanceEntryID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { tbStartDate.Text = DateTime.Now.ToString(); tbEndDate.Text = DateTime.Now.ToString(); tbDuration.Text = string.Empty; msMember.SelectedIndex = 0; msRank.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
protected void ok_Click(object sender, EventArgs e) { if (dojoBulkAttendanceEntryID == 0) { editDojoBulkAttendanceEntry = new DojoBulkAttendanceEntry(); } else { editDojoBulkAttendanceEntry = new DojoBulkAttendanceEntry(dojoBulkAttendanceEntryID); } editDojoBulkAttendanceEntry.StartDate = DateTime.Parse(tbStartDate.Text); editDojoBulkAttendanceEntry.EndDate = DateTime.Parse(tbEndDate.Text); editDojoBulkAttendanceEntry.Duration = TimeSpan.FromHours(double.Parse(tbDuration.Text)); if (ddMember.SelectedItem != null) { editDojoBulkAttendanceEntry.Member = DojoMember.NewPlaceHolder( int.Parse(ddMember.SelectedItem.Value)); } else { editDojoBulkAttendanceEntry.Member = null; } if (ddRank.SelectedItem != null) { editDojoBulkAttendanceEntry.Rank = DojoRank.NewPlaceHolder( int.Parse(ddRank.SelectedItem.Value)); } else { editDojoBulkAttendanceEntry.Rank = null; } if (editOnAdd) { dojoBulkAttendanceEntryID = editDojoBulkAttendanceEntry.Save(); } else { editDojoBulkAttendanceEntry.Save(); } if (resetOnAdd) { tbStartDate.Text = string.Empty; tbEndDate.Text = string.Empty; tbDuration.Text = string.Empty; ddMember.SelectedIndex = 0; ddRank.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
protected void ok_Click(object sender, EventArgs e) { if (dojoMemberID == 0) { obj = new DojoMember(); } else { obj = new DojoMember(dojoMemberID); } obj.MemberSince = deMemberSince.Date; obj.IsPrimaryOrgActive = cbIsPrimaryOrgActive.Checked; obj.IsParentOrgActive = cbIsParentOrgActive.Checked; obj.LastMembershipScan = DateTime.Parse(tbLastMembershipScan.Text); obj.AttendanceMessage = tbAttendanceMessage.Text; obj.HasWaiver = cbHasWaiver.Checked; obj.IsPromotable = cbIsPromotable.Checked; obj.IsInstructor = cbIsInstructor.Checked; obj.RankDate = deRankDate.Date; obj.IsPastDue = cbIsPastDue.Checked; if (msMemberType.SelectedItem != null && msMemberType.SelectedItem.Value != "Null") { obj.MemberType = DojoMemberType.NewPlaceHolder( int.Parse(msMemberType.SelectedItem.Value)); } else { obj.MemberType = null; } if (msPublicContact.SelectedItem != null && msPublicContact.SelectedItem.Value != "Null") { obj.PublicContact = GreyFoxContact.NewPlaceHolder("kitTessen_Members_PublicContacts", int.Parse(msPublicContact.SelectedItem.Value)); } else { obj.PublicContact = null; } if (msParentMember.SelectedItem != null && msParentMember.SelectedItem.Value != "Null") { obj.ParentMember = DojoMember.NewPlaceHolder( int.Parse(msParentMember.SelectedItem.Value)); } else { obj.ParentMember = null; } if (msPrimaryOrgMembership.SelectedItem != null && msPrimaryOrgMembership.SelectedItem.Value != "Null") { obj.PrimaryOrgMembership = DojoMembership.NewPlaceHolder( int.Parse(msPrimaryOrgMembership.SelectedItem.Value)); } else { obj.PrimaryOrgMembership = null; } if (msParentOrgMembership.SelectedItem != null && msParentOrgMembership.SelectedItem.Value != "Null") { obj.ParentOrgMembership = DojoMembership.NewPlaceHolder( int.Parse(msParentOrgMembership.SelectedItem.Value)); } else { obj.ParentOrgMembership = null; } if (msInstructor1.SelectedItem != null && msInstructor1.SelectedItem.Value != "Null") { obj.Instructor1 = DojoMember.NewPlaceHolder( int.Parse(msInstructor1.SelectedItem.Value)); } else { obj.Instructor1 = null; } if (msInstructor2.SelectedItem != null && msInstructor2.SelectedItem.Value != "Null") { obj.Instructor2 = DojoMember.NewPlaceHolder( int.Parse(msInstructor2.SelectedItem.Value)); } else { obj.Instructor2 = null; } if (msInstructor3.SelectedItem != null && msInstructor3.SelectedItem.Value != "Null") { obj.Instructor3 = DojoMember.NewPlaceHolder( int.Parse(msInstructor3.SelectedItem.Value)); } else { obj.Instructor3 = null; } if (msPromotionFlags.IsChanged) { obj.PromotionFlags = new DojoPromotionFlagCollection(); foreach (ListItem i in msPromotionFlags.Items) { if (i.Selected) { obj.PromotionFlags.Add(DojoPromotionFlag.NewPlaceHolder(int.Parse(i.Value))); } } } if (msRank.SelectedItem != null && msRank.SelectedItem.Value != "Null") { obj.Rank = DojoRank.NewPlaceHolder( int.Parse(msRank.SelectedItem.Value)); } else { obj.Rank = null; } if (msCustomer.SelectedItem != null && msCustomer.SelectedItem.Value != "Null") { obj.Customer = RHCustomer.NewPlaceHolder( int.Parse(msCustomer.SelectedItem.Value)); } else { obj.Customer = null; } if (editOnAdd) { dojoMemberID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { deMemberSince.Date = DateTime.Now; cbIsPrimaryOrgActive.Checked = false; cbIsParentOrgActive.Checked = false; tbLastMembershipScan.Text = DateTime.Now.ToString(); tbAttendanceMessage.Text = string.Empty; cbHasWaiver.Checked = false; cbIsPromotable.Checked = false; cbIsInstructor.Checked = false; deRankDate.Date = DateTime.Now; cbIsPastDue.Checked = false; msMemberType.SelectedIndex = 0; msPublicContact.SelectedIndex = 0; msParentMember.SelectedIndex = 0; msPrimaryOrgMembership.SelectedIndex = 0; msParentOrgMembership.SelectedIndex = 0; msInstructor1.SelectedIndex = 0; msInstructor2.SelectedIndex = 0; msInstructor3.SelectedIndex = 0; msRank.SelectedIndex = 0; msCustomer.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
protected void ok_Click(object sender, EventArgs e) { if (dojoRankID == 0) obj = new DojoRank(); else obj = new DojoRank(dojoRankID); obj.Name = tbName.Text; obj.PromotionTimeInRank = TimeSpan.Parse(tbPromotionTimeInRank.Text); obj.PromotionTimeFromLastTest = TimeSpan.Parse(tbPromotionTimeFromLastTest.Text); obj.PromotionRequirements = tbPromotionRequirements.Text; obj.PromotionFee = decimal.Parse(tbPromotionFee.Text); if (ddPromotionRank.SelectedItem != null && ddPromotionRank.SelectedValue != "null") { obj.PromotionRank = DojoRank.NewPlaceHolder(int.Parse(ddPromotionRank.SelectedValue)); } else { obj.PromotionRank = null; } obj.PromotionResetIP = cbPromotionResetIP.Checked; obj.OrderNum = int.Parse(tbOrderNum.Text); obj.Description = tbDescription.Text; if (ddItem.SelectedItem != null && ddItem.SelectedValue != "null") { obj.Item = RHItem.NewPlaceHolder(int.Parse(ddItem.SelectedValue)); } else { obj.Item = null; } if (editOnAdd) dojoRankID = obj.Save(); else obj.Save(); if (resetOnAdd) { DojoRank newObj = new DojoRank(); tbName.Text = newObj.Name; tbPromotionTimeInRank.Text = newObj.PromotionTimeInRank.ToString(); tbPromotionTimeFromLastTest.Text = newObj.PromotionTimeFromLastTest.ToString(); tbPromotionRequirements.Text = newObj.PromotionRequirements; tbPromotionFee.Text = newObj.PromotionFee.ToString(); if (newObj.PromotionRank != null) foreach (ListItem item in ddPromotionRank.Items) item.Selected = newObj.PromotionRank.ID.ToString() == item.Value; else if (ddPromotionRank.Items.Count > 0) ddPromotionRank.SelectedIndex = 0; cbPromotionResetIP.Checked = newObj.PromotionResetIP; tbOrderNum.Text = newObj.OrderNum.ToString(); tbDescription.Text = newObj.Description; if (newObj.Item != null) foreach (ListItem item in ddItem.Items) item.Selected = newObj.Item.ID.ToString() == item.Value; else if (ddItem.Items.Count > 0) ddItem.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
protected void ok_Click(object sender, EventArgs e) { if (dojoAttendanceEntryID == 0) { obj = new DojoAttendanceEntry(); } else { obj = new DojoAttendanceEntry(dojoAttendanceEntryID); } obj.SigninTime = DateTime.Parse(tbSigninTime.Text); obj.SignoutTime = DateTime.Parse(tbSignoutTime.Text); if (msClass.SelectedItem != null && msClass.SelectedItem.Value != "Null") { obj.Class = DojoClass.NewPlaceHolder( int.Parse(msClass.SelectedItem.Value)); } else { obj.Class = null; } if (msMember.SelectedItem != null && msMember.SelectedItem.Value != "Null") { obj.Member = DojoMember.NewPlaceHolder( int.Parse(msMember.SelectedItem.Value)); } else { obj.Member = null; } if (msRank.SelectedItem != null && msRank.SelectedItem.Value != "Null") { obj.Rank = DojoRank.NewPlaceHolder( int.Parse(msRank.SelectedItem.Value)); } else { obj.Rank = null; } if (editOnAdd) { dojoAttendanceEntryID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { tbSigninTime.Text = DateTime.Now.ToString(); tbSignoutTime.Text = DateTime.Now.ToString(); msClass.SelectedIndex = 0; msMember.SelectedIndex = 0; msRank.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
private void add() { DojoTest test; DojoMember member; member = new DojoMember(int.Parse(ddMember.SelectedValue)); if (dojoPromotionID == 0) { editDojoPromotion = new DojoPromotion(); } else { editDojoPromotion = new DojoPromotion(dojoPromotionID); } if (ddMember.SelectedItem != null) { editDojoPromotion.Member = member; } else { editDojoPromotion.Member = null; } // If a test is not selected, set the test to null // and the promotion date to the date entered unless // the date entered is blank. In the event it is blank // use the current date. // If the test is selected, use the test and test date // to set the promotion test and promotion date. if (ddTest.SelectedValue == "-1") { editDojoPromotion.Test = null; try { editDojoPromotion.PromotionDate = DateTime.Parse(tbPromotionDate.Text); } catch { editDojoPromotion.PromotionDate = DateTime.Now; tbPromotionDate.Text = DateTime.Now.ToString(); } } else { test = new DojoTest(int.Parse(ddTest.SelectedValue)); editDojoPromotion.Test = test; editDojoPromotion.PromotionDate = test.TestDate; tbPromotionDate.Text = ""; } if (ddPromotionRank.SelectedItem != null) { editDojoPromotion.PromotionRank = DojoRank.NewPlaceHolder( int.Parse(ddPromotionRank.SelectedItem.Value)); } else { editDojoPromotion.PromotionRank = null; } // If the Last Rank is "Current" then get the member's // last rank and set it. if (ddLastRank.SelectedValue == "-1") { editDojoPromotion.LastRank = member.Rank; } else { if (ddLastRank.SelectedItem != null) { editDojoPromotion.LastRank = DojoRank.NewPlaceHolder( int.Parse(ddLastRank.SelectedItem.Value)); } else { editDojoPromotion.LastRank = null; } } // Run an attendace adjustment on this rank. MembershipScan scan = new MembershipScan(); scan.AttendanceAdjustment(editDojoPromotion.Member); dojoPromotionID = editDojoPromotion.Save(); }
protected void ok_Click(object sender, EventArgs e) { if (dojoRankID == 0) { obj = new DojoRank(); } else { obj = new DojoRank(dojoRankID); } obj.Name = tbName.Text; obj.PromotionTimeInRank = TimeSpan.Parse(tbPromotionTimeInRank.Text); obj.PromotionTimeFromLastTest = TimeSpan.Parse(tbPromotionTimeFromLastTest.Text); obj.PromotionRequirements = tbPromotionRequirements.Text; obj.PromotionFee = decimal.Parse(tbPromotionFee.Text); obj.PromotionResetIP = cbPromotionResetIP.Checked; obj.OrderNum = int.Parse(tbOrderNum.Text); if (msPromotionRank.SelectedItem != null && msPromotionRank.SelectedItem.Value != "Null") { obj.PromotionRank = DojoRank.NewPlaceHolder( int.Parse(msPromotionRank.SelectedItem.Value)); } else { obj.PromotionRank = null; } if (msItem.SelectedItem != null && msItem.SelectedItem.Value != "Null") { obj.Item = RHItem.NewPlaceHolder( int.Parse(msItem.SelectedItem.Value)); } else { obj.Item = null; } if (editOnAdd) { dojoRankID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { tbName.Text = string.Empty; tbPromotionTimeInRank.Text = string.Empty; tbPromotionTimeFromLastTest.Text = string.Empty; tbPromotionRequirements.Text = string.Empty; tbPromotionFee.Text = string.Empty; cbPromotionResetIP.Checked = false; tbOrderNum.Text = string.Empty; msPromotionRank.SelectedIndex = 0; msItem.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }