Пример #1
0
        public static void FillClassLocations(DojoOrganizationCollection dojoOrganizationCollection)
        {
            StringBuilder s;
            Database      database;
            DbCommand     dbCommand;
            IDataReader   r;

            if (dojoOrganizationCollection.Count > 0)
            {
                s = new StringBuilder("SELECT DojoOrganizationID, GreyFoxContactID FROM kitTessen_OrganizationsChildren_ClassLocations ORDER BY DojoOrganizationID; ");

                // Clone and sort collection by ID first to fill children in one pass
                DojoOrganizationCollection clonedCollection = dojoOrganizationCollection.Clone();
                clonedCollection.Sort();

                database  = DatabaseFactory.CreateDatabase();
                dbCommand = database.GetSqlStringCommand(s.ToString());
                r         = database.ExecuteReader(dbCommand);

                bool more = r.Read();

                foreach (DojoOrganization dojoOrganization in clonedCollection)
                {
                    GreyFoxContactCollection classLocations;
                    if (dojoOrganization.classLocations != null)
                    {
                        classLocations = dojoOrganization.classLocations;
                        classLocations.Clear();
                    }
                    else
                    {
                        classLocations = new GreyFoxContactCollection();
                        dojoOrganization.classLocations = classLocations;
                    }

                    while (more)
                    {
                        if (r.GetInt32(0) < dojoOrganization.iD)
                        {
                            more = r.Read();
                        }
                        else if (r.GetInt32(0) == dojoOrganization.iD)
                        {
                            classLocations.Add(GreyFoxContact.NewPlaceHolder("kitTessen_Locations", r.GetInt32(1)));
                            more = r.Read();
                        }
                        else
                        {
                            break;
                        }
                    }

                    // No need to continue if there are no more records
                    if (!more)
                    {
                        break;
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Fills the {0} from a OleIDataReader.
        /// </summary>
        public static void FillFromReader(DojoSeminar dojoSeminar, IDataReader r, int idOffset, int dataOffset)
        {
            dojoSeminar.iD            = r.GetInt32(idOffset);
            dojoSeminar.isSynced      = true;
            dojoSeminar.isPlaceHolder = false;

            dojoSeminar.name        = r.GetString(0 + dataOffset);
            dojoSeminar.startDate   = r.GetDateTime(1 + dataOffset);
            dojoSeminar.endDate     = r.GetDateTime(2 + dataOffset);
            dojoSeminar.description = r.GetString(3 + dataOffset);
            dojoSeminar.isLocal     = r.GetBoolean(4 + dataOffset);
            if (!r.IsDBNull(5 + dataOffset) && r.GetInt32(5 + dataOffset) > 0)
            {
                dojoSeminar.location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations", r.GetInt32(5 + dataOffset));
            }
            dojoSeminar.classUnitFee             = r.GetDecimal(6 + dataOffset);
            dojoSeminar.classUnitType            = (DojoSeminarClassUnitType)r.GetByte(7 + dataOffset);
            dojoSeminar.baseRegistrationFee      = r.GetDecimal(8 + dataOffset);
            dojoSeminar.registrationEnabled      = r.GetBoolean(9 + dataOffset);
            dojoSeminar.registrationStart        = r.GetDateTime(10 + dataOffset);
            dojoSeminar.fullEarlyRegistrationFee = r.GetDecimal(11 + dataOffset);
            dojoSeminar.earlyEndDate             = r.GetDateTime(12 + dataOffset);
            dojoSeminar.fullRegistrationFee      = r.GetDecimal(13 + dataOffset);
            dojoSeminar.lateStartDate            = r.GetDateTime(14 + dataOffset);
            dojoSeminar.fullLateRegistrationFee  = r.GetDecimal(15 + dataOffset);
            dojoSeminar.registrationEnd          = r.GetDateTime(16 + dataOffset);
            dojoSeminar.details            = r.GetString(17 + dataOffset);
            dojoSeminar.detailsOverrideUrl = r.GetString(18 + dataOffset);
            dojoSeminar.pdfUrl             = r.GetString(19 + dataOffset);
            if (!r.IsDBNull(20 + dataOffset) && r.GetInt32(20 + dataOffset) > 0)
            {
                dojoSeminar.item = RHItem.NewPlaceHolder(r.GetInt32(20 + dataOffset));
            }
        }
Пример #3
0
        /// <summary>
        /// Fills the {0} from a OleIDataReader.
        /// </summary>
        public static void FillFromReader(DojoOrganization dojoOrganization, IDataReader r, int idOffset, int dataOffset)
        {
            dojoOrganization.iD            = r.GetInt32(idOffset);
            dojoOrganization.isSynced      = true;
            dojoOrganization.isPlaceHolder = false;

            dojoOrganization.name        = r.GetString(0 + dataOffset);
            dojoOrganization.description = r.GetString(1 + dataOffset);
            if (!r.IsDBNull(2 + dataOffset) && r.GetInt32(2 + dataOffset) > 0)
            {
                dojoOrganization.location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations", r.GetInt32(2 + dataOffset));
            }
            if (!r.IsDBNull(3 + dataOffset) && r.GetInt32(3 + dataOffset) > 0)
            {
                dojoOrganization.administrativeContact = GreyFoxContact.NewPlaceHolder("sysGlobal_Contacts", r.GetInt32(3 + dataOffset));
            }
            dojoOrganization.webServiceUrl = r.GetString(4 + dataOffset);
            dojoOrganization.refreshTime   = TimeSpan.FromTicks((long)r.GetDouble(5 + dataOffset));
            dojoOrganization.isPrimary     = r.GetBoolean(6 + dataOffset);
            if (!r.IsDBNull(7 + dataOffset) && r.GetInt32(7 + dataOffset) > 0)
            {
                dojoOrganization.defaultMemberType = DojoMemberType.NewPlaceHolder(r.GetInt32(7 + dataOffset));
            }
            dojoOrganization.promotionFlagEnabled = r.GetBoolean(8 + dataOffset);
        }
Пример #4
0
 /// <summary>
 /// Deep copies the current DojoSeminar to another instance of DojoSeminar.
 /// </summary>
 /// <param name="DojoSeminar">The DojoSeminar to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoSeminar from its children.</param>
 public void CopyTo(DojoSeminar dojoSeminar, bool isolation)
 {
     dojoSeminar.iD            = iD;
     dojoSeminar.isPlaceHolder = isPlaceHolder;
     dojoSeminar.isSynced      = isSynced;
     dojoSeminar.name          = name;
     dojoSeminar.startDate     = startDate;
     dojoSeminar.endDate       = endDate;
     dojoSeminar.description   = description;
     dojoSeminar.isLocal       = isLocal;
     if (location != null)
     {
         if (isolation)
         {
             dojoSeminar.location = location.NewPlaceHolder();
         }
         else
         {
             dojoSeminar.location = location.Copy(false);
         }
     }
     dojoSeminar.classUnitFee             = classUnitFee;
     dojoSeminar.classUnitType            = classUnitType;
     dojoSeminar.baseRegistrationFee      = baseRegistrationFee;
     dojoSeminar.registrationEnabled      = registrationEnabled;
     dojoSeminar.registrationStart        = registrationStart;
     dojoSeminar.fullEarlyRegistrationFee = fullEarlyRegistrationFee;
     dojoSeminar.earlyEndDate             = earlyEndDate;
     dojoSeminar.fullRegistrationFee      = fullRegistrationFee;
     dojoSeminar.lateStartDate            = lateStartDate;
     dojoSeminar.fullLateRegistrationFee  = fullLateRegistrationFee;
     dojoSeminar.registrationEnd          = registrationEnd;
     if (options != null)
     {
         if (isolation)
         {
             dojoSeminar.options = options.Copy(true);
         }
         else
         {
             dojoSeminar.options = options.Copy(false);
         }
     }
     dojoSeminar.details            = details;
     dojoSeminar.detailsOverrideUrl = detailsOverrideUrl;
     dojoSeminar.pdfUrl             = pdfUrl;
     if (item != null)
     {
         if (isolation)
         {
             dojoSeminar.item = item.NewPlaceHolder();
         }
         else
         {
             dojoSeminar.item = item.Copy(false);
         }
     }
 }
Пример #5
0
 /// <summary>
 /// Deep copies the current DojoOrganization to another instance of DojoOrganization.
 /// </summary>
 /// <param name="DojoOrganization">The DojoOrganization to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoOrganization from its children.</param>
 public void CopyTo(DojoOrganization dojoOrganization, bool isolation)
 {
     dojoOrganization.iD            = iD;
     dojoOrganization.isPlaceHolder = isPlaceHolder;
     dojoOrganization.isSynced      = isSynced;
     dojoOrganization.name          = name;
     dojoOrganization.description   = description;
     if (location != null)
     {
         if (isolation)
         {
             dojoOrganization.location = location.NewPlaceHolder();
         }
         else
         {
             dojoOrganization.location = location.Copy(false);
         }
     }
     if (classLocations != null)
     {
         if (isolation)
         {
             dojoOrganization.classLocations = classLocations.Copy(true);
         }
         else
         {
             dojoOrganization.classLocations = classLocations.Copy(false);
         }
     }
     if (administrativeContact != null)
     {
         if (isolation)
         {
             dojoOrganization.administrativeContact = administrativeContact.NewPlaceHolder();
         }
         else
         {
             dojoOrganization.administrativeContact = administrativeContact.Copy(false);
         }
     }
     dojoOrganization.webServiceUrl = webServiceUrl;
     dojoOrganization.refreshTime   = refreshTime;
     dojoOrganization.isPrimary     = isPrimary;
     if (defaultMemberType != null)
     {
         if (isolation)
         {
             dojoOrganization.defaultMemberType = defaultMemberType.NewPlaceHolder();
         }
         else
         {
             dojoOrganization.defaultMemberType = defaultMemberType.Copy(false);
         }
     }
     dojoOrganization.promotionFlagEnabled = promotionFlagEnabled;
 }
Пример #6
0
 /// <summary>
 /// Deep copies the current DojoClassDefinition to another instance of DojoClassDefinition.
 /// </summary>
 /// <param name="DojoClassDefinition">The DojoClassDefinition to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoClassDefinition from its children.</param>
 public void CopyTo(DojoClassDefinition dojoClassDefinition, bool isolation)
 {
     dojoClassDefinition.iD               = iD;
     dojoClassDefinition.isPlaceHolder    = isPlaceHolder;
     dojoClassDefinition.isSynced         = isSynced;
     dojoClassDefinition.name             = name;
     dojoClassDefinition.description      = description;
     dojoClassDefinition.isDisabled       = isDisabled;
     dojoClassDefinition.occupancyAvg     = occupancyAvg;
     dojoClassDefinition.occupancyAvgDate = occupancyAvgDate;
     if (accessControlGroup != null)
     {
         if (isolation)
         {
             dojoClassDefinition.accessControlGroup = accessControlGroup.NewPlaceHolder();
         }
         else
         {
             dojoClassDefinition.accessControlGroup = accessControlGroup.Copy(false);
         }
     }
     dojoClassDefinition.recurrenceCount = recurrenceCount;
     dojoClassDefinition.recurrenceEnd   = recurrenceEnd;
     dojoClassDefinition.recurrenceSpan  = recurrenceSpan;
     dojoClassDefinition.recurrenceType  = recurrenceType;
     dojoClassDefinition.nextSigninStart = nextSigninStart;
     dojoClassDefinition.nextSigninEnd   = nextSigninEnd;
     dojoClassDefinition.nextClassStart  = nextClassStart;
     dojoClassDefinition.nextClassEnd    = nextClassEnd;
     if (instructor != null)
     {
         if (isolation)
         {
             dojoClassDefinition.instructor = instructor.NewPlaceHolder();
         }
         else
         {
             dojoClassDefinition.instructor = instructor.Copy(false);
         }
     }
     if (location != null)
     {
         if (isolation)
         {
             dojoClassDefinition.location = location.NewPlaceHolder();
         }
         else
         {
             dojoClassDefinition.location = location.Copy(false);
         }
     }
 }
Пример #7
0
        /// <summary>
        /// An object to cache the parameterized query for full name queries.
        /// </summary>
        public GreyFoxContact FindByFullName(string fullName, bool placeHolderOnly)
        {
            StringBuilder  query;
            Database       database;
            DbCommand      dbCommand;
            IDataReader    r;
            GreyFoxContact c;

            // create a new contact to parse a name into.
            c = new GreyFoxContact(tableName);
            c.ParseName(fullName);

            query = new StringBuilder();
            query.Append("SELECT ");
            if (placeHolderOnly)
            {
                query.Append(InnerJoinFields[0]);
            }
            else
            {
                query.Append(string.Join(",", InnerJoinFields));
            }
            query.Append(" FROM ");
            query.Append(tableName);
            query.Append(" WHERE FirstName=@FirstName AND " +
                         "MiddleName=@MiddleName AND " +
                         "LastName=@LastName AND " +
                         "Suffix=@Suffix;");

            database  = DatabaseFactory.CreateDatabase();
            dbCommand = database.GetSqlStringCommand(query.ToString());

            addParameter(database, dbCommand, "FirstName", DbType.String, c.firstName);
            addParameter(database, dbCommand, "MiddleName", DbType.String, c.middleName);
            addParameter(database, dbCommand, "LastName", DbType.String, c.lastName);
            addParameter(database, dbCommand, "Suffix", DbType.String, c.Suffix);

            r = database.ExecuteReader(dbCommand);
            if (r.Read())
            {
                if (placeHolderOnly)
                {
                    c = GreyFoxContact.NewPlaceHolder(tableName, r.GetInt32(0));
                }
                else
                {
                    c = GreyFoxContactManager.ParseFromReader(tableName, r, 0, 1);
                }
            }
            return(c);
        }
Пример #8
0
        public GreyFoxContact FindByBusinessName(string businessName, bool placeHolderOnly)
        {
            StringBuilder  query;
            Database       database;
            DbCommand      dbCommand;
            IDataReader    r;
            GreyFoxContact c;

            query = new StringBuilder();
            query.Append("SELECT ");
            if (placeHolderOnly)
            {
                query.Append(InnerJoinFields[0]);
            }
            else
            {
                query.Append(string.Join(",", InnerJoinFields));
            }
            query.Append(" FROM ");
            query.Append(tableName);
            query.Append(" WHERE BusinessName=@BusinessName;");

            database  = DatabaseFactory.CreateDatabase();
            dbCommand = database.GetSqlStringCommand(query.ToString());
            addParameter(database, dbCommand, "BusinessName", DbType.String, businessName);
            r = database.ExecuteReader(dbCommand);

            if (r.Read())
            {
                if (placeHolderOnly)
                {
                    c = GreyFoxContact.NewPlaceHolder(tableName, r.GetInt32(0));
                }
                else
                {
                    c = GreyFoxContactManager.ParseFromReader(tableName, r, 0, 1);
                }
            }
            else
            {
                c = new GreyFoxContact(tableName);
                c.BusinessName = businessName;
            }

            return(c);
        }
Пример #9
0
        /// <summary>
        /// Fills the {0} from a OleIDataReader.
        /// </summary>
        public static void FillFromReader(GreyFoxUser greyFoxUser, IDataReader r, int idOffset, int dataOffset)
        {
            greyFoxUser.iD            = r.GetInt32(idOffset);
            greyFoxUser.isSynced      = true;
            greyFoxUser.isPlaceHolder = false;

            greyFoxUser.userName = r.GetString(0 + dataOffset);
            if (!r.IsDBNull(1 + dataOffset))
            {
                greyFoxUser.isDisabled = r.GetBoolean(1 + dataOffset);
            }
            if (!r.IsDBNull(2 + dataOffset))
            {
                greyFoxUser.loginDate = r.GetDateTime(2 + dataOffset);
            }
            else
            {
                greyFoxUser.loginDate = DateTime.MinValue;
            }
            if (!r.IsDBNull(3 + dataOffset))
            {
                greyFoxUser.loginCount = r.GetInt32(3 + dataOffset);
            }
            if (!r.IsDBNull(4 + dataOffset))
            {
                greyFoxUser.loginPassword = r.GetString(4 + dataOffset);
            }
            else
            {
                greyFoxUser.loginPassword = null;
            }
            if (!r.IsDBNull(5 + dataOffset) && r.GetInt32(5 + dataOffset) > 0)
            {
                greyFoxUser.contact = GreyFoxContact.NewPlaceHolder("sysGlobal_Contacts", r.GetInt32(5 + dataOffset));
            }
            if (!r.IsDBNull(6 + dataOffset))
            {
                greyFoxUser.activationID = r.GetString(6 + dataOffset);
            }
            else
            {
                greyFoxUser.activationID = string.Empty;
            }
        }
Пример #10
0
        public static void FillClassLocations(DojoOrganization dojoOrganization)
        {
            StringBuilder s;
            Database      database;
            DbCommand     dbCommand;
            IDataReader   r;

            s = new StringBuilder("SELECT GreyFoxContactID FROM kitTessen_OrganizationsChildren_ClassLocations ");
            s.Append("WHERE DojoOrganizationID=");
            s.Append(dojoOrganization.iD);
            s.Append(";");

            database  = DatabaseFactory.CreateDatabase();
            dbCommand = database.GetSqlStringCommand(s.ToString());
            r         = database.ExecuteReader(dbCommand);

            GreyFoxContactCollection classLocations;

            if (dojoOrganization.classLocations != null)
            {
                classLocations = dojoOrganization.classLocations;
                classLocations.Clear();
            }
            else
            {
                classLocations = new GreyFoxContactCollection();
                dojoOrganization.classLocations = classLocations;
            }

            while (r.Read())
            {
                classLocations.Add(GreyFoxContact.NewPlaceHolder("kitTessen_Locations", r.GetInt32(0)));
            }

            dojoOrganization.ClassLocations = classLocations;
            // Store DojoOrganization in cache.
            if (cacheEnabled)
            {
                cacheStore(dojoOrganization);
            }
        }
Пример #11
0
 /// <summary>
 /// Deep copies the current GreyFoxUser to another instance of GreyFoxUser.
 /// </summary>
 /// <param name="GreyFoxUser">The GreyFoxUser to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the GreyFoxUser from its children.</param>
 public void CopyTo(GreyFoxUser greyFoxUser, bool isolation)
 {
     lock (this)
     {
         greyFoxUser.iD            = iD;
         greyFoxUser.isPlaceHolder = isPlaceHolder;
         greyFoxUser.isSynced      = isSynced;
         greyFoxUser.userName      = userName;
         greyFoxUser.isDisabled    = isDisabled;
         greyFoxUser.loginDate     = loginDate;
         greyFoxUser.loginCount    = loginCount;
         greyFoxUser.loginPassword = loginPassword;
         if (contact != null)
         {
             if (isolation)
             {
                 greyFoxUser.contact = contact.NewPlaceHolder();
             }
             else
             {
                 greyFoxUser.contact = contact.Copy(false);
             }
         }
         if (roles != null)
         {
             if (isolation)
             {
                 greyFoxUser.roles = roles.Copy(true);
             }
             else
             {
                 greyFoxUser.roles = roles.Copy(false);
             }
         }
         greyFoxUser.activationID = activationID;
     }
 }
Пример #12
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoSeminarRegistrationID == 0)
            {
                obj = new DojoSeminarRegistration();
            }
            else
            {
                obj = new DojoSeminarRegistration(dojoSeminarRegistrationID);
            }

            obj.Status           = byte.Parse(tbStatus.Text);
            obj.RegistrationDate = deRegistrationDate.Date;
            obj.ClassUnits       = int.Parse(tbClassUnits.Text);
            obj.TotalFee         = decimal.Parse(tbTotalFee.Text);
            obj.PaymentDate      = dePaymentDate.Date;
            obj.PaymentReference = tbPaymentReference.Text;
            obj.PaymentAmount    = decimal.Parse(tbPaymentAmount.Text);

            if (msContact.SelectedItem != null && msContact.SelectedItem.Value != "Null")
            {
                obj.Contact = GreyFoxContact.NewPlaceHolder("kitTessen_SeminarRegistrations_Contacts",
                                                            int.Parse(msContact.SelectedItem.Value));
            }
            else
            {
                obj.Contact = null;
            }

            if (msCustomer.SelectedItem != null && msCustomer.SelectedItem.Value != "Null")
            {
                obj.Customer = RHCustomer.NewPlaceHolder(
                    int.Parse(msCustomer.SelectedItem.Value));
            }
            else
            {
                obj.Customer = null;
            }

            if (msInvoiceLine.SelectedItem != null && msInvoiceLine.SelectedItem.Value != "Null")
            {
                obj.InvoiceLine = RHInvoiceLine.NewPlaceHolder(
                    int.Parse(msInvoiceLine.SelectedItem.Value));
            }
            else
            {
                obj.InvoiceLine = null;
            }

            if (msSalesOrderLine.SelectedItem != null && msSalesOrderLine.SelectedItem.Value != "Null")
            {
                obj.SalesOrderLine = RHSalesOrderLine.NewPlaceHolder(
                    int.Parse(msSalesOrderLine.SelectedItem.Value));
            }
            else
            {
                obj.SalesOrderLine = null;
            }

            if (editOnAdd)
            {
                dojoSeminarRegistrationID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbStatus.Text                  = string.Empty;
                deRegistrationDate.Date        = DateTime.Now;
                tbClassUnits.Text              = string.Empty;
                tbTotalFee.Text                = string.Empty;
                dePaymentDate.Date             = DateTime.Now;
                tbPaymentReference.Text        = string.Empty;
                tbPaymentAmount.Text           = string.Empty;
                msContact.SelectedIndex        = 0;
                msCustomer.SelectedIndex       = 0;
                msInvoiceLine.SelectedIndex    = 0;
                msSalesOrderLine.SelectedIndex = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #13
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoClassDefinitionID == 0)
            {
                obj = new DojoClassDefinition();
            }
            else
            {
                obj = new DojoClassDefinition(dojoClassDefinitionID);
            }

            obj.Name             = tbName.Text;
            obj.Description      = tbDescription.Text;
            obj.IsDisabled       = cbIsDisabled.Checked;
            obj.OccupancyAvg     = int.Parse(tbOccupancyAvg.Text);
            obj.OccupancyAvgDate = DateTime.Parse(tbOccupancyAvgDate.Text);
            obj.RecurrenceType   = byte.Parse(tbRecurrenceType.Text);
            obj.RecurrenceCount  = int.Parse(tbRecurrenceCount.Text);
            obj.RecurrenceEnd    = DateTime.Parse(tbRecurrenceEnd.Text);
            obj.RecurrenceSpan   = TimeSpan.Parse(tbRecurrenceSpan.Text);
            obj.NextSigninStart  = DateTime.Parse(tbNextSigninStart.Text);
            obj.NextSigninEnd    = DateTime.Parse(tbNextSigninEnd.Text);
            obj.NextClassStart   = DateTime.Parse(tbNextClassStart.Text);
            obj.NextClassEnd     = DateTime.Parse(tbNextClassEnd.Text);

            if (msAccessControlGroup.SelectedItem != null && msAccessControlGroup.SelectedItem.Value != "Null")
            {
                obj.AccessControlGroup = DojoAccessControlGroup.NewPlaceHolder(
                    int.Parse(msAccessControlGroup.SelectedItem.Value));
            }
            else
            {
                obj.AccessControlGroup = null;
            }

            if (msInstructor.SelectedItem != null && msInstructor.SelectedItem.Value != "Null")
            {
                obj.Instructor = DojoMember.NewPlaceHolder(
                    int.Parse(msInstructor.SelectedItem.Value));
            }
            else
            {
                obj.Instructor = null;
            }

            if (msLocation.SelectedItem != null && msLocation.SelectedItem.Value != "Null")
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations",
                                                             int.Parse(msLocation.SelectedItem.Value));
            }
            else
            {
                obj.Location = null;
            }

            if (editOnAdd)
            {
                dojoClassDefinitionID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                        = string.Empty;
                tbDescription.Text                 = string.Empty;
                cbIsDisabled.Checked               = false;
                tbOccupancyAvg.Text                = string.Empty;
                tbOccupancyAvgDate.Text            = DateTime.Now.ToString();
                tbRecurrenceType.Text              = string.Empty;
                tbRecurrenceCount.Text             = string.Empty;
                tbRecurrenceEnd.Text               = DateTime.Now.ToString();
                tbRecurrenceSpan.Text              = string.Empty;
                tbNextSigninStart.Text             = DateTime.Now.ToString();
                tbNextSigninEnd.Text               = DateTime.Now.ToString();
                tbNextClassStart.Text              = DateTime.Now.ToString();
                tbNextClassEnd.Text                = DateTime.Now.ToString();
                msAccessControlGroup.SelectedIndex = 0;
                msInstructor.SelectedIndex         = 0;
                msLocation.SelectedIndex           = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #14
0
 /// <summary>
 /// Deep copies the current DojoClass to another instance of DojoClass.
 /// </summary>
 /// <param name="DojoClass">The DojoClass to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoClass from its children.</param>
 public void CopyTo(DojoClass dojoClass, bool isolation)
 {
     dojoClass.iD            = iD;
     dojoClass.isPlaceHolder = isPlaceHolder;
     dojoClass.isSynced      = isSynced;
     dojoClass.name          = name;
     if (instructor != null)
     {
         if (isolation)
         {
             dojoClass.instructor = instructor.NewPlaceHolder();
         }
         else
         {
             dojoClass.instructor = instructor.Copy(false);
         }
     }
     if (parentSeminar != null)
     {
         if (isolation)
         {
             dojoClass.parentSeminar = parentSeminar.NewPlaceHolder();
         }
         else
         {
             dojoClass.parentSeminar = parentSeminar.Copy(false);
         }
     }
     if (parentDefinition != null)
     {
         if (isolation)
         {
             dojoClass.parentDefinition = parentDefinition.NewPlaceHolder();
         }
         else
         {
             dojoClass.parentDefinition = parentDefinition.Copy(false);
         }
     }
     if (location != null)
     {
         if (isolation)
         {
             dojoClass.location = location.NewPlaceHolder();
         }
         else
         {
             dojoClass.location = location.Copy(false);
         }
     }
     if (accessControlGroup != null)
     {
         if (isolation)
         {
             dojoClass.accessControlGroup = accessControlGroup.NewPlaceHolder();
         }
         else
         {
             dojoClass.accessControlGroup = accessControlGroup.Copy(false);
         }
     }
     dojoClass.occupancyMax       = occupancyMax;
     dojoClass.occupancyTarget    = occupancyTarget;
     dojoClass.occupancyCurrent   = occupancyCurrent;
     dojoClass.occupancyCheckDate = occupancyCheckDate;
     dojoClass.signinStart        = signinStart;
     dojoClass.signinEnd          = signinEnd;
     dojoClass.classStart         = classStart;
     dojoClass.classEnd           = classEnd;
 }
Пример #15
0
        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);
        }
Пример #16
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoOrganizationID == 0)
            {
                obj = new DojoOrganization();
            }
            else
            {
                obj = new DojoOrganization(dojoOrganizationID);
            }

            obj.Name                 = tbName.Text;
            obj.Description          = tbDescription.Text;
            obj.WebServiceUrl        = tbWebServiceUrl.Text;
            obj.RefreshTime          = TimeSpan.Parse(tbRefreshTime.Text);
            obj.IsPrimary            = cbIsPrimary.Checked;
            obj.PromotionFlagEnabled = cbPromotionFlagEnabled.Checked;

            if (msLocation.SelectedItem != null && msLocation.SelectedItem.Value != "Null")
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations",
                                                             int.Parse(msLocation.SelectedItem.Value));
            }
            else
            {
                obj.Location = null;
            }

            if (msClassLocations.IsChanged)
            {
                obj.ClassLocations = new GreyFoxContactCollection();
                foreach (ListItem i in msClassLocations.Items)
                {
                    if (i.Selected)
                    {
                        obj.ClassLocations.Add(GreyFoxContact.NewPlaceHolder("kitTessen_Locations", int.Parse(i.Value)));
                    }
                }
            }

            if (msAdministrativeContact.SelectedItem != null && msAdministrativeContact.SelectedItem.Value != "Null")
            {
                obj.AdministrativeContact = GreyFoxContact.NewPlaceHolder("sysGlobal_Contacts",
                                                                          int.Parse(msAdministrativeContact.SelectedItem.Value));
            }
            else
            {
                obj.AdministrativeContact = null;
            }

            if (msDefaultMemberType.SelectedItem != null && msDefaultMemberType.SelectedItem.Value != "Null")
            {
                obj.DefaultMemberType = DojoMemberType.NewPlaceHolder(
                    int.Parse(msDefaultMemberType.SelectedItem.Value));
            }
            else
            {
                obj.DefaultMemberType = null;
            }

            if (editOnAdd)
            {
                dojoOrganizationID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                           = string.Empty;
                tbDescription.Text                    = string.Empty;
                tbWebServiceUrl.Text                  = string.Empty;
                tbRefreshTime.Text                    = string.Empty;
                cbIsPrimary.Checked                   = false;
                cbPromotionFlagEnabled.Checked        = false;
                msLocation.SelectedIndex              = 0;
                msAdministrativeContact.SelectedIndex = 0;
                msDefaultMemberType.SelectedIndex     = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #17
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoSeminarID == 0)
            {
                obj = new DojoSeminar();
            }
            else
            {
                obj = new DojoSeminar(dojoSeminarID);
            }

            obj.Name                     = tbName.Text;
            obj.StartDate                = DateTime.Parse(tbStartDate.Text);
            obj.EndDate                  = DateTime.Parse(tbEndDate.Text);
            obj.Description              = tbDescription.Text;
            obj.IsLocal                  = cbIsLocal.Checked;
            obj.ClassUnitType            = byte.Parse(tbClassUnitType.Text);
            obj.ClassUnitFee             = decimal.Parse(tbClassUnitFee.Text);
            obj.BaseRegistrationFee      = decimal.Parse(tbBaseRegistrationFee.Text);
            obj.RegistrationEnabled      = cbRegistrationEnabled.Checked;
            obj.RegistrationStart        = DateTime.Parse(tbRegistrationStart.Text);
            obj.FullEarlyRegistrationFee = decimal.Parse(tbFullEarlyRegistrationFee.Text);
            obj.EarlyEndDate             = DateTime.Parse(tbEarlyEndDate.Text);
            obj.FullRegistrationFee      = decimal.Parse(tbFullRegistrationFee.Text);
            obj.LateStartDate            = DateTime.Parse(tbLateStartDate.Text);
            obj.FullLateRegistrationFee  = decimal.Parse(tbFullLateRegistrationFee.Text);
            obj.RegistrationEnd          = DateTime.Parse(tbRegistrationEnd.Text);
            obj.Details                  = ftbDetails.Text;
            obj.DetailsOverrideUrl       = tbDetailsOverrideUrl.Text;
            obj.PdfUrl                   = tbPdfUrl.Text;

            if (msLocation.SelectedItem != null && msLocation.SelectedItem.Value != "Null")
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations",
                                                             int.Parse(msLocation.SelectedItem.Value));
            }
            else
            {
                obj.Location = null;
            }

            if (msOptions.IsChanged)
            {
                obj.Options = new DojoSeminarOptionCollection();
                foreach (ListItem i in msOptions.Items)
                {
                    if (i.Selected)
                    {
                        obj.Options.Add(DojoSeminarOption.NewPlaceHolder(int.Parse(i.Value)));
                    }
                }
            }

            if (msItem.SelectedItem != null && msItem.SelectedItem.Value != "Null")
            {
                obj.Item = RHItem.NewPlaceHolder(
                    int.Parse(msItem.SelectedItem.Value));
            }
            else
            {
                obj.Item = null;
            }

            if (editOnAdd)
            {
                dojoSeminarID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                     = string.Empty;
                tbStartDate.Text                = DateTime.Now.ToString();
                tbEndDate.Text                  = DateTime.Now.ToString();
                tbDescription.Text              = string.Empty;
                cbIsLocal.Checked               = false;
                tbClassUnitType.Text            = string.Empty;
                tbClassUnitFee.Text             = string.Empty;
                tbBaseRegistrationFee.Text      = string.Empty;
                cbRegistrationEnabled.Checked   = false;
                tbRegistrationStart.Text        = DateTime.Now.ToString();
                tbFullEarlyRegistrationFee.Text = string.Empty;
                tbEarlyEndDate.Text             = DateTime.Now.ToString();
                tbFullRegistrationFee.Text      = string.Empty;
                tbLateStartDate.Text            = DateTime.Now.ToString();
                tbFullLateRegistrationFee.Text  = string.Empty;
                tbRegistrationEnd.Text          = DateTime.Now.ToString();
                ftbDetails.Text                 = string.Empty;
                tbDetailsOverrideUrl.Text       = string.Empty;
                tbPdfUrl.Text                   = string.Empty;
                msLocation.SelectedIndex        = 0;
                msItem.SelectedIndex            = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #18
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoTestID == 0)
            {
                obj = new DojoTest();
            }
            else
            {
                obj = new DojoTest(dojoTestID);
            }

            obj.Name        = tbName.Text;
            obj.Description = tbDescription.Text;
            obj.TestDate    = DateTime.Parse(tbTestDate.Text);
            if (comboLocation.SelectedItem != null)
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations", int.Parse(comboLocation.SelectedValue));
            }
            else
            {
                obj.Location = null;
            }
            if (comboListMemberType1.SelectedItem != null)
            {
                obj.ListMemberType1 = DojoMemberType.NewPlaceHolder(int.Parse(comboListMemberType1.SelectedValue));
            }
            else
            {
                obj.ListMemberType1 = null;
            }
            if (comboListMemberType2.SelectedItem != null)
            {
                obj.ListMemberType2 = DojoMemberType.NewPlaceHolder(int.Parse(comboListMemberType2.SelectedValue));
            }
            else
            {
                obj.ListMemberType2 = null;
            }
            if (comboListMemberType3.SelectedItem != null)
            {
                obj.ListMemberType3 = DojoMemberType.NewPlaceHolder(int.Parse(comboListMemberType3.SelectedValue));
            }
            else
            {
                obj.ListMemberType3 = null;
            }
            if (ddPanelChief.SelectedItem != null && ddPanelChief.SelectedValue != "null")
            {
                obj.PanelChief = DojoMember.NewPlaceHolder(int.Parse(ddPanelChief.SelectedValue));
            }
            else
            {
                obj.PanelChief = null;
            }
            DojoMemberManager panelMembersManager = new DojoMemberManager();

            obj.PanelMembers = panelMembersManager.DecodeString(tbPanelMembers.Text, "");

            if (comboStatus.SelectedItem != null)
            {
                obj.Status = DojoTestListStatus.NewPlaceHolder(int.Parse(comboStatus.SelectedValue));
            }
            else
            {
                obj.Status = null;
            }
            if (ddActiveTestList.SelectedItem != null && ddActiveTestList.SelectedValue != "null")
            {
                obj.ActiveTestList = DojoTestList.NewPlaceHolder(int.Parse(ddActiveTestList.SelectedValue));
            }
            else
            {
                obj.ActiveTestList = null;
            }
            if (comboItem.SelectedItem != null)
            {
                obj.Item = RHItem.NewPlaceHolder(int.Parse(comboItem.SelectedValue));
            }
            else
            {
                obj.Item = null;
            }
            if (editOnAdd)
            {
                dojoTestID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                DojoTest newObj = new DojoTest();
                tbName.Text        = newObj.Name;
                tbDescription.Text = newObj.Description;
                tbTestDate.Text    = newObj.TestDate.ToString();
                if (newObj.Location != null)
                {
                    comboLocation.Text = newObj.Location.BusinessName;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboLocation.Items)
                    {
                        if (item.Value == newObj.Location.ID.ToString())
                        {
                            comboLocation.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboLocation.Text         = string.Empty;
                    comboLocation.SelectedItem = null;
                }
                if (newObj.ListMemberType1 != null)
                {
                    comboListMemberType1.Text = newObj.ListMemberType1.Name;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboListMemberType1.Items)
                    {
                        if (item.Value == newObj.ListMemberType1.ID.ToString())
                        {
                            comboListMemberType1.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboListMemberType1.Text         = string.Empty;
                    comboListMemberType1.SelectedItem = null;
                }
                if (newObj.ListMemberType2 != null)
                {
                    comboListMemberType2.Text = newObj.ListMemberType2.Name;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboListMemberType2.Items)
                    {
                        if (item.Value == newObj.ListMemberType2.ID.ToString())
                        {
                            comboListMemberType2.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboListMemberType2.Text         = string.Empty;
                    comboListMemberType2.SelectedItem = null;
                }
                if (newObj.ListMemberType3 != null)
                {
                    comboListMemberType3.Text = newObj.ListMemberType3.Name;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboListMemberType3.Items)
                    {
                        if (item.Value == newObj.ListMemberType3.ID.ToString())
                        {
                            comboListMemberType3.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboListMemberType3.Text         = string.Empty;
                    comboListMemberType3.SelectedItem = null;
                }
                if (newObj.PanelChief != null)
                {
                    foreach (ListItem item in ddPanelChief.Items)
                    {
                        item.Selected = newObj.PanelChief.ID.ToString() == item.Value;
                    }
                }
                else if (ddPanelChief.Items.Count > 0)
                {
                    ddPanelChief.SelectedIndex = 0;
                }

                tbPanelMembers.Text = newObj.PanelMembers.ToEncodedString("\r\n", "");
                if (newObj.Status != null)
                {
                    comboStatus.Text = newObj.Status.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboStatus.Items)
                    {
                        if (item.Value == newObj.Status.ID.ToString())
                        {
                            comboStatus.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboStatus.Text         = string.Empty;
                    comboStatus.SelectedItem = null;
                }
                if (newObj.ActiveTestList != null)
                {
                    foreach (ListItem item in ddActiveTestList.Items)
                    {
                        item.Selected = newObj.ActiveTestList.ID.ToString() == item.Value;
                    }
                }
                else if (ddActiveTestList.Items.Count > 0)
                {
                    ddActiveTestList.SelectedIndex = 0;
                }

                if (newObj.Item != null)
                {
                    comboItem.Text = newObj.Item.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboItem.Items)
                    {
                        if (item.Value == newObj.Item.ID.ToString())
                        {
                            comboItem.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboItem.Text         = string.Empty;
                    comboItem.SelectedItem = null;
                }
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #19
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoClassID == 0)
            {
                obj = new DojoClass();
            }
            else
            {
                obj = new DojoClass(dojoClassID);
            }

            obj.Name = tbName.Text;
            if (comboInstructor.SelectedItem != null && comboInstructor.SelectedItem.Value != "Null")
            {
                obj.Instructor = DojoMember.NewPlaceHolder(
                    int.Parse(comboInstructor.SelectedItem.Value));
            }
            else
            {
                obj.Instructor = null;
            }

            if (comboParentSeminar.SelectedItem != null && comboParentSeminar.SelectedItem.Value != "Null")
            {
                obj.ParentSeminar = DojoSeminar.NewPlaceHolder(
                    int.Parse(comboParentSeminar.SelectedItem.Value));
            }
            else
            {
                obj.ParentSeminar = null;
            }

            if (comboParentDefinition.SelectedItem != null && comboParentDefinition.SelectedItem.Value != "Null")
            {
                obj.ParentDefinition = DojoClassDefinition.NewPlaceHolder(
                    int.Parse(comboParentDefinition.SelectedItem.Value));
            }
            else
            {
                obj.ParentDefinition = null;
            }

            if (comboLocation.SelectedItem != null && comboLocation.SelectedItem.Value != "Null")
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations",
                                                             int.Parse(comboLocation.SelectedItem.Value));
            }
            else
            {
                obj.Location = null;
            }

            if (comboAccessControlGroup.SelectedItem != null && comboAccessControlGroup.SelectedItem.Value != "Null")
            {
                obj.AccessControlGroup = DojoAccessControlGroup.NewPlaceHolder(
                    int.Parse(comboAccessControlGroup.SelectedItem.Value));
            }
            else
            {
                obj.AccessControlGroup = null;
            }

            obj.OccupancyMax       = int.Parse(tbOccupancyMax.Text);
            obj.OccupancyTarget    = int.Parse(tbOccupancyTarget.Text);
            obj.OccupancyCurrent   = int.Parse(tbOccupancyCurrent.Text);
            obj.OccupancyCheckDate = DateTime.Parse(tbOccupancyCheckDate.Text);
            obj.SigninStart        = DateTime.Parse(tbSigninStart.Text);
            obj.SigninEnd          = DateTime.Parse(tbSigninEnd.Text);
            obj.ClassStart         = DateTime.Parse(tbClassStart.Text);
            obj.ClassEnd           = DateTime.Parse(tbClassEnd.Text);
            if (editOnAdd)
            {
                dojoClassID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                           = string.Empty;
                tbOccupancyMax.Text                   = string.Empty;
                tbOccupancyTarget.Text                = string.Empty;
                tbOccupancyCurrent.Text               = string.Empty;
                tbOccupancyCheckDate.Text             = DateTime.Now.ToString();
                tbSigninStart.Text                    = DateTime.Now.ToString();
                tbSigninEnd.Text                      = DateTime.Now.ToString();
                tbClassStart.Text                     = DateTime.Now.ToString();
                tbClassEnd.Text                       = DateTime.Now.ToString();
                comboInstructor.SelectedIndex         = 0;
                comboParentSeminar.SelectedIndex      = 0;
                comboParentDefinition.SelectedIndex   = 0;
                comboLocation.SelectedIndex           = 0;
                comboAccessControlGroup.SelectedIndex = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #20
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (greyFoxUserID == 0)
            {
                obj = new GreyFoxUser();
            }
            else
            {
                obj = new GreyFoxUser(greyFoxUserID);
            }

            obj.UserName      = tbUserName.Text;
            obj.IsDisabled    = cbIsDisabled.Checked;
            obj.LoginDate     = DateTime.Parse(tbLoginDate.Text);
            obj.LoginCount    = int.Parse(tbLoginCount.Text);
            obj.LoginPassword = tbLoginPassword.Text;
            obj.ActivationID  = tbActivationID.Text;

            if (msContact.SelectedItem != null && msContact.SelectedItem.Value != "Null")
            {
                obj.Contact = GreyFoxContact.NewPlaceHolder("sysGlobal_Contacts",
                                                            int.Parse(msContact.SelectedItem.Value));
            }
            else
            {
                obj.Contact = null;
            }

            if (msRoles.IsChanged)
            {
                obj.Roles = new GreyFoxRoleCollection();
                foreach (ListItem i in msRoles.Items)
                {
                    if (i.Selected)
                    {
                        obj.Roles.Add(GreyFoxRole.NewPlaceHolder(int.Parse(i.Value)));
                    }
                }
            }

            if (editOnAdd)
            {
                greyFoxUserID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbUserName.Text         = string.Empty;
                cbIsDisabled.Checked    = false;
                tbLoginDate.Text        = DateTime.Now.ToString();
                tbLoginCount.Text       = string.Empty;
                tbLoginPassword.Text    = string.Empty;
                tbActivationID.Text     = string.Empty;
                msContact.SelectedIndex = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #21
0
 /// <summary>
 /// Deep copies the current DojoSeminarRegistration to another instance of DojoSeminarRegistration.
 /// </summary>
 /// <param name="DojoSeminarRegistration">The DojoSeminarRegistration to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoSeminarRegistration from its children.</param>
 public void CopyTo(DojoSeminarRegistration dojoSeminarRegistration, bool isolation)
 {
     dojoSeminarRegistration.iD            = iD;
     dojoSeminarRegistration.isPlaceHolder = isPlaceHolder;
     dojoSeminarRegistration.isSynced      = isSynced;
     dojoSeminarRegistration.status        = status;
     if (parentSeminar != null)
     {
         if (isolation)
         {
             dojoSeminarRegistration.parentSeminar = parentSeminar.NewPlaceHolder();
         }
         else
         {
             dojoSeminarRegistration.parentSeminar = parentSeminar.Copy(false);
         }
     }
     dojoSeminarRegistration.registrationDate = registrationDate;
     dojoSeminarRegistration.classUnits       = classUnits;
     dojoSeminarRegistration.sessionID        = sessionID;
     dojoSeminarRegistration.seminarFee       = seminarFee;
     dojoSeminarRegistration.totalFee         = totalFee;
     dojoSeminarRegistration.paymentDate      = paymentDate;
     dojoSeminarRegistration.paymentReference = paymentReference;
     dojoSeminarRegistration.paymentAmount    = paymentAmount;
     if (contact != null)
     {
         if (isolation)
         {
             dojoSeminarRegistration.contact = contact.NewPlaceHolder();
         }
         else
         {
             dojoSeminarRegistration.contact = contact.Copy(false);
         }
     }
     if (invoiceLine != null)
     {
         if (isolation)
         {
             dojoSeminarRegistration.invoiceLine = invoiceLine.NewPlaceHolder();
         }
         else
         {
             dojoSeminarRegistration.invoiceLine = invoiceLine.Copy(false);
         }
     }
     if (salesOrderLine != null)
     {
         if (isolation)
         {
             dojoSeminarRegistration.salesOrderLine = salesOrderLine.NewPlaceHolder();
         }
         else
         {
             dojoSeminarRegistration.salesOrderLine = salesOrderLine.Copy(false);
         }
     }
     if (customer != null)
     {
         if (isolation)
         {
             dojoSeminarRegistration.customer = customer.NewPlaceHolder();
         }
         else
         {
             dojoSeminarRegistration.customer = customer.Copy(false);
         }
     }
 }
Пример #22
0
 /// <summary>
 /// Deep copies the current DojoTest to another instance of DojoTest.
 /// </summary>
 /// <param name="DojoTest">The DojoTest to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoTest from its children.</param>
 public void CopyTo(DojoTest dojoTest, bool isolation)
 {
     dojoTest.iD            = iD;
     dojoTest.isPlaceHolder = isPlaceHolder;
     dojoTest.isSynced      = isSynced;
     dojoTest.name          = name;
     dojoTest.description   = description;
     dojoTest.testDate      = testDate;
     if (location != null)
     {
         if (isolation)
         {
             dojoTest.location = location.NewPlaceHolder();
         }
         else
         {
             dojoTest.location = location.Copy(false);
         }
     }
     if (listMemberType1 != null)
     {
         if (isolation)
         {
             dojoTest.listMemberType1 = listMemberType1.NewPlaceHolder();
         }
         else
         {
             dojoTest.listMemberType1 = listMemberType1.Copy(false);
         }
     }
     if (listMemberType2 != null)
     {
         if (isolation)
         {
             dojoTest.listMemberType2 = listMemberType2.NewPlaceHolder();
         }
         else
         {
             dojoTest.listMemberType2 = listMemberType2.Copy(false);
         }
     }
     if (listMemberType3 != null)
     {
         if (isolation)
         {
             dojoTest.listMemberType3 = listMemberType3.NewPlaceHolder();
         }
         else
         {
             dojoTest.listMemberType3 = listMemberType3.Copy(false);
         }
     }
     if (panelChief != null)
     {
         if (isolation)
         {
             dojoTest.panelChief = panelChief.NewPlaceHolder();
         }
         else
         {
             dojoTest.panelChief = panelChief.Copy(false);
         }
     }
     if (panelMembers != null)
     {
         if (isolation)
         {
             dojoTest.panelMembers = panelMembers.Copy(true);
         }
         else
         {
             dojoTest.panelMembers = panelMembers.Copy(false);
         }
     }
     if (status != null)
     {
         if (isolation)
         {
             dojoTest.status = status.NewPlaceHolder();
         }
         else
         {
             dojoTest.status = status.Copy(false);
         }
     }
     if (activeTestList != null)
     {
         if (isolation)
         {
             dojoTest.activeTestList = activeTestList.NewPlaceHolder();
         }
         else
         {
             dojoTest.activeTestList = activeTestList.Copy(false);
         }
     }
     if (item != null)
     {
         if (isolation)
         {
             dojoTest.item = item.NewPlaceHolder();
         }
         else
         {
             dojoTest.item = item.Copy(false);
         }
     }
 }
Пример #23
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoTestID == 0)
            {
                obj = new DojoTest();
            }
            else
            {
                obj = new DojoTest(dojoTestID);
            }

            obj.Name        = tbName.Text;
            obj.Description = tbDescription.Text;
            obj.TestDate    = DateTime.Parse(tbTestDate.Text);

            if (msLocation.SelectedItem != null && msLocation.SelectedItem.Value != "Null")
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations",
                                                             int.Parse(msLocation.SelectedItem.Value));
            }
            else
            {
                obj.Location = null;
            }

            if (msListMemberType1.SelectedItem != null && msListMemberType1.SelectedItem.Value != "Null")
            {
                obj.ListMemberType1 = DojoMemberType.NewPlaceHolder(
                    int.Parse(msListMemberType1.SelectedItem.Value));
            }
            else
            {
                obj.ListMemberType1 = null;
            }

            if (msListMemberType2.SelectedItem != null && msListMemberType2.SelectedItem.Value != "Null")
            {
                obj.ListMemberType2 = DojoMemberType.NewPlaceHolder(
                    int.Parse(msListMemberType2.SelectedItem.Value));
            }
            else
            {
                obj.ListMemberType2 = null;
            }

            if (msListMemberType3.SelectedItem != null && msListMemberType3.SelectedItem.Value != "Null")
            {
                obj.ListMemberType3 = DojoMemberType.NewPlaceHolder(
                    int.Parse(msListMemberType3.SelectedItem.Value));
            }
            else
            {
                obj.ListMemberType3 = null;
            }

            if (msPanelChief.SelectedItem != null && msPanelChief.SelectedItem.Value != "Null")
            {
                obj.PanelChief = DojoMember.NewPlaceHolder(
                    int.Parse(msPanelChief.SelectedItem.Value));
            }
            else
            {
                obj.PanelChief = null;
            }

            if (msPanelMember1.SelectedItem != null && msPanelMember1.SelectedItem.Value != "Null")
            {
                obj.PanelMember1 = DojoMember.NewPlaceHolder(
                    int.Parse(msPanelMember1.SelectedItem.Value));
            }
            else
            {
                obj.PanelMember1 = null;
            }

            if (msPanelMember2.SelectedItem != null && msPanelMember2.SelectedItem.Value != "Null")
            {
                obj.PanelMember2 = DojoMember.NewPlaceHolder(
                    int.Parse(msPanelMember2.SelectedItem.Value));
            }
            else
            {
                obj.PanelMember2 = null;
            }

            if (msPanelMember3.SelectedItem != null && msPanelMember3.SelectedItem.Value != "Null")
            {
                obj.PanelMember3 = DojoMember.NewPlaceHolder(
                    int.Parse(msPanelMember3.SelectedItem.Value));
            }
            else
            {
                obj.PanelMember3 = null;
            }

            if (msPanelMember4.SelectedItem != null && msPanelMember4.SelectedItem.Value != "Null")
            {
                obj.PanelMember4 = DojoMember.NewPlaceHolder(
                    int.Parse(msPanelMember4.SelectedItem.Value));
            }
            else
            {
                obj.PanelMember4 = null;
            }

            if (msPanelMember5.SelectedItem != null && msPanelMember5.SelectedItem.Value != "Null")
            {
                obj.PanelMember5 = DojoMember.NewPlaceHolder(
                    int.Parse(msPanelMember5.SelectedItem.Value));
            }
            else
            {
                obj.PanelMember5 = null;
            }

            if (msStatus.SelectedItem != null && msStatus.SelectedItem.Value != "Null")
            {
                obj.Status = DojoTestListStatus.NewPlaceHolder(
                    int.Parse(msStatus.SelectedItem.Value));
            }
            else
            {
                obj.Status = null;
            }

            if (msActiveTestList.SelectedItem != null && msActiveTestList.SelectedItem.Value != "Null")
            {
                obj.ActiveTestList = DojoTestList.NewPlaceHolder(
                    int.Parse(msActiveTestList.SelectedItem.Value));
            }
            else
            {
                obj.ActiveTestList = null;
            }

            if (msItem.SelectedItem != null && msItem.SelectedItem.Value != "Null")
            {
                obj.Item = RHItem.NewPlaceHolder(
                    int.Parse(msItem.SelectedItem.Value));
            }
            else
            {
                obj.Item = null;
            }

            if (editOnAdd)
            {
                dojoTestID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                     = string.Empty;
                tbDescription.Text              = string.Empty;
                tbTestDate.Text                 = DateTime.Now.ToString();
                msLocation.SelectedIndex        = 0;
                msListMemberType1.SelectedIndex = 0;
                msListMemberType2.SelectedIndex = 0;
                msListMemberType3.SelectedIndex = 0;
                msPanelChief.SelectedIndex      = 0;
                msPanelMember1.SelectedIndex    = 0;
                msPanelMember2.SelectedIndex    = 0;
                msPanelMember3.SelectedIndex    = 0;
                msPanelMember4.SelectedIndex    = 0;
                msPanelMember5.SelectedIndex    = 0;
                msStatus.SelectedIndex          = 0;
                msActiveTestList.SelectedIndex  = 0;
                msItem.SelectedIndex            = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #24
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoSeminarID == 0)
            {
                editDojoSeminar = new DojoSeminar();
            }
            else
            {
                editDojoSeminar = new DojoSeminar(dojoSeminarID);
            }

            editDojoSeminar.Name                = tbName.Text;
            editDojoSeminar.StartDate           = calStartP.SelectedDate;
            editDojoSeminar.EndDate             = calEndP.SelectedDate;
            editDojoSeminar.Description         = tbDescription.Text;
            editDojoSeminar.PdfUrl              = tbPdfUrl.Text;
            editDojoSeminar.ClassUnitFee        = decimal.Parse(tbClassUnitFee.Text);
            editDojoSeminar.BaseRegistrationFee = decimal.Parse(tbBaseRegistrationFee.Text);
            editDojoSeminar.RegistrationEnabled = cbRegistrationEnabled.Checked;

            editDojoSeminar.RegistrationStart        = calRegStartP.SelectedDate;
            editDojoSeminar.FullEarlyRegistrationFee = decimal.Parse(tbFullEarlyRegistrationFee.Text);
            editDojoSeminar.EarlyEndDate             = calEarlyEndP.SelectedDate;
            editDojoSeminar.FullRegistrationFee      = decimal.Parse(tbFullRegistrationFee.Text);
            editDojoSeminar.LateStartDate            = calLateStartP.SelectedDate;
            editDojoSeminar.FullLateRegistrationFee  = decimal.Parse(tbFullLateRegistrationFee.Text);
            editDojoSeminar.RegistrationEnd          = calRegEndP.SelectedDate;

            editDojoSeminar.DetailsOverrideUrl = tbDetailsOverrideUrl.Text;

            editDojoSeminar.ClassUnitType = (DojoSeminarClassUnitType)
                                            Enum.Parse(typeof(DojoSeminarClassUnitType), ddClassUnitType.SelectedItem.Value);
            editDojoSeminar.Details = tbDetails.Text;
            editDojoSeminar.IsLocal = cbIsLocal.Checked;

            if (msOptions.IsChanged)
            {
                editDojoSeminar.Options = new DojoSeminarOptionCollection();
                foreach (ListItem i in msOptions.Items)
                {
                    if (i.Selected)
                    {
                        editDojoSeminar.Options.Add(DojoSeminarOption.NewPlaceHolder(int.Parse(i.Value)));
                    }
                }
            }

            /// Selects the specified location, otherwise
            /// creates a new location.
            if (comboLocation.SelectedItem != null)
            {
                editDojoSeminar.Location =
                    GreyFoxContact.NewPlaceHolder(DojoSeminarManager.LocationTable,
                                                  int.Parse(comboLocation.SelectedValue));
            }
            else
            {
                if (comboLocation.Text != string.Empty)
                {
                    GreyFoxContact location =
                        new GreyFoxContact(DojoSeminarManager.LocationTable);
                    location.BusinessName = comboLocation.Text;
                    location.Save();
                    editDojoSeminar.Location = location;
                }
                else
                {
                    editDojoSeminar.Location = null;
                }
            }

            // Set the Rappahanock Item, otherwise create a new
            // item in Rappahanock that is tied to the seminar.
            // This is for SalesOrder and invoicing.
            if (comboRappahanockItem.SelectedItem != null)
            {
                editDojoSeminar.Item =
                    RHItem.NewPlaceHolder(
                        int.Parse(comboRappahanockItem.SelectedValue));
            }
            else
            {
                if (comboRappahanockItem.Text != string.Empty)
                {
                    RHItem newItem = RHFactory.ServiceItem(
                        comboRappahanockItem.Text,
                        tbDescription.Text,
                        decimal.Parse(tbFullRegistrationFee.Text),
                        null);
                    newItem.Save();
                    editDojoSeminar.Item = newItem;
                }
                else
                {
                    editDojoSeminar.Item = null;
                }
            }

            if (editOnAdd)
            {
                dojoSeminarID = editDojoSeminar.Save();
            }
            else
            {
                editDojoSeminar.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                   = string.Empty;
                calStartP.SelectedDate        = DateTime.Now;
                calEndP.SelectedDate          = DateTime.Now;
                tbDescription.Text            = string.Empty;
                tbPdfUrl.Text                 = string.Empty;
                tbClassUnitFee.Text           = string.Empty;
                tbBaseRegistrationFee.Text    = string.Empty;
                cbRegistrationEnabled.Checked = false;

                calRegStartP.SelectedDate       = DateTime.Now;
                tbFullEarlyRegistrationFee.Text = "0";
                calEarlyEndP.SelectedDate       = DateTime.Now;
                tbFullRegistrationFee.Text      = "0";
                calLateStartP.SelectedDate      = DateTime.Now;
                tbFullLateRegistrationFee.Text  = "0";
                calRegEndP.SelectedDate         = DateTime.Now;

                tbDetailsOverrideUrl.Text = string.Empty;

                ddClassUnitType.SelectedIndex = 0;
                tbDetails.Text     = string.Empty;
                cbIsLocal.Checked  = false;
                comboLocation.Text = string.Empty;
            }

            OnUpdated(EventArgs.Empty);
        }