protected void ok_Click(object sender, EventArgs e) { if (dojoPromotionFlagID == 0) { editDojoPromotionFlag = new DojoPromotionFlag(); } else { editDojoPromotionFlag = new DojoPromotionFlag(dojoPromotionFlagID); } editDojoPromotionFlag.Name = tbName.Text; if (editOnAdd) { dojoPromotionFlagID = editDojoPromotionFlag.Save(); } else { editDojoPromotionFlag.Save(); } if (resetOnAdd) { tbName.Text = string.Empty; } OnUpdated(EventArgs.Empty); }
protected override void OnPreRender(EventArgs e) { if (dojoPromotionFlagID != 0) { dojoPromotionFlag = new DojoPromotionFlag(dojoPromotionFlagID); #region Bind Default Folder // // Set Field Entries // ltName.Text = dojoPromotionFlag.Name.ToString(); #endregion #region Bind _system Folder // // Set Field Entries // #endregion text = "View - " + dojoPromotionFlag.ToString(); } }
protected void btOk_Click(object sender, EventArgs e) { DojoPromotionFlag dojoPromotionFlag = new DojoPromotionFlag(dojoPromotionFlagID); dojoPromotionFlag.Delete(); dojoPromotionFlagID = 0; OnDeleted(EventArgs.Empty); }
public void Remove(DojoPromotionFlag value) { OnCollectionChanged(EventArgs.Empty); int index = IndexOf(value); if (index == -1) { throw(new Exception("DojoPromotionFlag not found in collection.")); } RemoveAt(index); }
public int Add(DojoPromotionFlag value) { OnCollectionChanged(EventArgs.Empty); lock (this) { count++; ensureArrays(); addIndexKey(value.ID); DojoPromotionFlagArray[count - 1] = value; return(count - 1); } }
protected override void OnPreRender(EventArgs e) { if (dojoPromotionFlagID != 0) { dojoPromotionFlag = new DojoPromotionFlag(dojoPromotionFlagID); text = "Delete - " + dojoPromotionFlag.ToString(); } else { text = "Delete "; } }
public void Add(DojoPromotionFlag dojoPromotionFlag, TimeSpan slidingExpiration) { lock (this) { count++; ensureArrays(); dojoPromotionFlagArray[count - 1] = dojoPromotionFlag; timeStamps[count - 1] = DateTime.Now; absoluteExpirations[count - 1] = DateTime.Now.Add(slidingExpiration); // Never Expires slidingExpirations[count - 1] = slidingExpiration; // Never slides quickSort(0, count - 1); } }
public int IndexOf(DojoPromotionFlag value) { lock (this) { for (int x = 0; x < count; x++) { if (DojoPromotionFlagArray[x].Equals(value)) { return(x); } } } return(-1); }
public void Insert(int index, DojoPromotionFlag value) { OnCollectionChanged(EventArgs.Empty); lock (this) { count++; ensureArrays(); addIndexKey(value.ID); for (int x = index + 1; x == count - 2; x++) { DojoPromotionFlagArray[x] = DojoPromotionFlagArray[x - 1]; } DojoPromotionFlagArray[index] = value; } }
/// <summary> /// Ensures that the index and object array are sized correctly /// for additions. This method should be protected by locks /// issued by calling methods. /// </summary> private void ensureArrays() { if (count > DojoPromotionFlagArray.GetUpperBound(0) + 1) { int[,] tempIndex = new int[count * 2, 2]; DojoPromotionFlag[] tempDojoPromotionFlagArray = new DojoPromotionFlag[count * 2]; for (int x = 0; x <= DojoPromotionFlagArray.GetUpperBound(0); x++) { tempIndex[x, 0] = index[x, 0]; // Copy ID tempIndex[x, 1] = index[x, 1]; // Copy Location tempDojoPromotionFlagArray[x] = DojoPromotionFlagArray[x]; // Copy Object } index = tempIndex; DojoPromotionFlagArray = tempDojoPromotionFlagArray; } }
/// <summary> /// Ensures that the index and object array are sized correctly /// for additions. This method should be protected by locks /// issued by calling methods. /// </summary> private void ensureArrays() { if (count > dojoPromotionFlagArray.GetUpperBound(0) + 1) { DojoPromotionFlag[] tempDojoPromotionFlagArray = new DojoPromotionFlag[count * 2]; DateTime[] tempTimeStamps = new DateTime[count * 2]; DateTime[] tempAbsoluteExpirations = new DateTime[count * 2]; TimeSpan[] tempSlidingExpirations = new TimeSpan[count * 2]; Array.Copy(dojoPromotionFlagArray, tempDojoPromotionFlagArray, count - 1); Array.Copy(timeStamps, tempTimeStamps, count - 1); Array.Copy(absoluteExpirations, tempAbsoluteExpirations, count - 1); Array.Copy(slidingExpirations, tempSlidingExpirations, count - 1); dojoPromotionFlagArray = tempDojoPromotionFlagArray; timeStamps = tempTimeStamps; absoluteExpirations = tempAbsoluteExpirations; slidingExpirations = tempSlidingExpirations; } }
public void CheckedAdd(DojoPromotionFlag dojoPromotionFlag, TimeSpan slidingExpiration) { lock (this) { int i = binarySearch(dojoPromotionFlag.iD); if (i != -1) { dojoPromotionFlagArray[i] = dojoPromotionFlag; absoluteExpirations[i] = DateTime.Now.Add(slidingExpiration); // Expires slidingExpirations[i] = slidingExpiration; // Never slides return; } count++; ensureArrays(); dojoPromotionFlagArray[count - 1] = dojoPromotionFlag; timeStamps[count - 1] = DateTime.Now; absoluteExpirations[count - 1] = DateTime.Now.Add(slidingExpiration); // Expires slidingExpirations[count - 1] = slidingExpiration; // Never slides quickSort(0, count - 1); } }
protected override void OnPreRender(EventArgs e) { if (loadFlag) { if (dojoPromotionFlagID > 0) { editDojoPromotionFlag = new DojoPromotionFlag(dojoPromotionFlagID); text = "Edit - " + editDojoPromotionFlag.ToString(); } else if (dojoPromotionFlagID <= 0) { editDojoPromotionFlag = new DojoPromotionFlag(); text = "Add "; } // // Set Field Entries // tbName.Text = editDojoPromotionFlag.Name; } }
public bool Contains(DojoPromotionFlag value) { return(IndexOf(value) != -1); }
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); }