示例#1
0
 public void MarkCanceled()
 {
     StatusHistory.Add(OrderStatus.Create(
                           Id,
                           OrderStatusEnum.CANCELED
                           ));
 }
示例#2
0
 public void MarkShipped()
 {
     StatusHistory.Add(OrderStatus.Create(
                           Id,
                           OrderStatusEnum.SHIPPED
                           ));
 }
示例#3
0
 public void MarkFulfilled()
 {
     StatusHistory.Add(OrderStatus.Create(
                           Id,
                           OrderStatusEnum.FULFILLED
                           ));
 }
示例#4
0
 public void MarkPending()
 {
     StatusHistory.Add(OrderStatus.Create(
                           Id,
                           OrderStatusEnum.PENDING
                           ));
 }
示例#5
0
 public void MarkComplete()
 {
     StatusHistory.Add(OrderStatus.Create(
                           Id,
                           OrderStatusEnum.COMPLETE
                           ));
 }
示例#6
0
        /// <summary>
        /// Returns false if application cannot be finalized due to all forms not being
        /// submitted
        /// </summary>
        /// <returns></returns>
        public virtual bool SubmitAndFinalize()
        {
            // There can be no unassigned forms
            foreach (var form in GetOrderedForms())
            {
                if (form.IsRequired && !form.IsAssigned)
                {
                    return(false);
                }
            }
            bool isIncomplete = HasStatus(EApplicationStatus.DeemedIncomplete);

            // There can be no warnings within the review. Also the application cannot be any step past submitted or resubmitted
            if (Review().Count > 0 ||
                (!isIncomplete ? CurrentStatusLog.Status > EApplicationStatus.Submitted : CurrentStatusLog.Status >= EApplicationStatus.Resubmitted))
            {
                return(false);
            }
            foreach (var form in GetOrderedForms())
            {
                if (form is SignatureForm)
                {
                    ((SignatureForm)form).Signatures.ForEach(x => x.IsSignatureFinalized = true);
                }
            }
            StatusHistory.Add(ApplicationStatusLogItem.FactoryCreate(isIncomplete ? EApplicationStatus.Resubmitted : EApplicationStatus.Submitted));
            CanEdit = false;
            return(true);
        }
示例#7
0
 public void MarkIncomplete()
 {
     StatusHistory.Add(OrderStatus.Create(
                           Id
                           ));
 }
示例#8
0
        private void LoadData(DataSet ds)
        {
            const int TBL_GENERAL        = 0;
            const int TBL_LOCATIONS      = 1;
            const int TBL_STATUS_HISTORY = 2;
            const int TBL_CURRENT_ICONS  = 3;
            const int TBL_CURRENT_FILES  = 4;
            const int TBL_CURRENT_ACCESS = 5;

            const int ROW_FIRST = 0;

            DataTable dtGeneral = ds.Tables[TBL_GENERAL];

            if (dtGeneral.Rows.Count > 0)
            {
                DataRow dr = dtGeneral.Rows[ROW_FIRST];

                // badge info
                Badge.BadgeID           = (int)dr["BadgeID"];
                Badge.BadgeNumber       = (string)dr["BadgeNumber"];
                Badge.BadgeColor        = (string)dr["BadgeColor"];
                Badge.WhenBecomesActive = (DateTime)dr["WhenBadgeBecomesActive"];
                Badge.WhenExpires       = (DateTime)dr["WhenBadgeExpires"];
                Badge.BadgeStatus       = (string)dr["BadgeStatus"];

                // person info
                Person.NamePrefix = (string)dr["NamePrefixDescription"];
                Person.FirstName  = (string)dr["FirstName"];
                Person.MiddleName = (string)dr["MiddleName"];
                Person.LastName   = (string)dr["LastName"];
                Person.NameSuffix = (string)dr["NameSuffixDescription"];

                // Unknown info
                Miscellaneous.FingerprintDate = Badge.WhenBecomesActive;
                Miscellaneous.PrintDate       = Badge.WhenBecomesActive;
                Miscellaneous.PrintUser       = "******";

                // Company info
                Company.CompanyCode     = (string)dr["CompanyCode"];
                Company.CompanyID       = (int)dr["CompanyID"];
                Company.CorporationName = (string)dr["CorporationName"];

                // Division info
                Division.DivisionID   = (int)dr["DivisionID"];
                Division.DivisionCode = (string)dr["DivisionCode"];
                Division.DivisionName = (string)dr["DivisionName"];

                if (dr.Table.Columns.Contains("DivisionTypeName"))
                {
                    Division.DivisionTypeName = (string)dr["DivisionTypeName"];
                }

                Division.JobRole = (string)dr["JobRoleDescription"];
            }


            DataTable dtLocations = ds.Tables[TBL_LOCATIONS];

            if (dtLocations.Rows.Count > 0)
            {
                foreach (DataRow row in dtLocations.Rows)
                {
                    Locations.Add(new Location(row));
                }

                SelectedLocation = Locations[0];
            }

            DataTable dtStatusHistory = ds.Tables[TBL_STATUS_HISTORY];

            StatusHistory.Clear();
            if (dtStatusHistory.Rows.Count > 0)
            {
                foreach (DataRow row in dtStatusHistory.Rows)
                {
                    StatusHistory.Add(new BadgeStatusPeriod(row));
                }
            }

            DataTable dtCurrentIcons = ds.Tables[TBL_CURRENT_ICONS];

            CurrentIcons.Clear();
            if (dtCurrentIcons.Rows.Count > 0)
            {
                foreach (DataRow row in dtCurrentIcons.Rows)
                {
                    CurrentIcons.Add(new BadgeIcon(row));
                }
            }

            DataTable dtCurrentFiles = ds.Tables[TBL_CURRENT_FILES];

            CurrentFiles.Clear();
            if (dtCurrentFiles.Rows.Count > 0)
            {
                foreach (DataRow row in dtCurrentFiles.Rows)
                {
                    CurrentFiles.Add(new BadgeFile(row));
                }
            }

            /****
             *                      else
             *                      {
             *                              CurrentFiles.Add(new BadgeFile("text file (54) (spoofed data)", "54", "text/plain"));
             *                              CurrentFiles.Add(new BadgeFile("pdf file (5) (spoofed data)", "5", "application/pdf"));
             *                      }
             */

            DataTable dt = ds.Tables[TBL_CURRENT_ACCESS];

            CurrentAccess.Clear();
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    CurrentAccess.Add(new BadgeAccessCategory(row));
                }
            }

            /***
             * else
             * {
             *      CurrentAccess.Add(new BadgeAccessCategory());
             *      CurrentAccess.Add(new BadgeAccessCategory());
             *      CurrentAccess.Add(new BadgeAccessCategory());
             *      CurrentAccess.Add(new BadgeAccessCategory());
             * }
             */
        }