Exemplo n.º 1
0
        public static string GetDisplayStringDisasterKindName(string disasterKindCode)
        {
            System.Diagnostics.Debug.Assert(disasterKindCode != null);

            DisasterKind kind = BasisData.FindDisasterKindByCode(disasterKindCode);

            if (kind == null || kind.Name == null)
            {
                return("Unknown(" + disasterKindCode + ")");
            }
            return(kind.Name);
        }
Exemplo n.º 2
0
        public string GetHeadlineString()
        {
            if (this == null)
            {
                return(string.Empty);
            }

            try
            {
                CAPHelper     helper      = new CAPHelper();
                StringBuilder headline    = new StringBuilder();
                string        association = string.Empty;

                if (this.LocationKind == OrderLocationKind.Other)
                {
                    association = "[연계] ";
                }

                CAP    msg            = new CAP(this.CapText);
                string headlineNormal = helper.MakeHeadline(msg);
                if (string.IsNullOrEmpty(headlineNormal))
                {
                    headline.Append(headlineNormal);
                }

                if (headline.Length < 1)
                {
                    OrderMode mode = BasisData.FindOrderModeInfoByCode(this.OrderMode);
                    if (mode == null)
                    {
                        headline.Append(this.OrderedTime + " [ Unknown ]");
                    }
                    else
                    {
                        headline.Append(this.OrderedTime + " [" + mode.Name + "]");
                    }

                    string targets = helper.ExtractTargetNamesFromCAP(msg);
                    if (!string.IsNullOrEmpty(targets))
                    {
                        headline.Append("[" + targets.Replace(',', '/') + "] 대상으로");
                    }
                    else
                    {
                        headline.Append("[ Unknown ] 대상으로");
                    }

                    string disasterName = "Unknown";
                    if (msg.Info != null && msg.Info.Count > 0)
                    {
                        disasterName = msg.Info[0].Event;
                    }
                    else
                    {
                        DisasterKind disasterKind = BasisData.FindDisasterKindByCode(this.DisasterKindCode);
                        if (disasterKind != null)
                        {
                            disasterName = disasterKind.Name;
                        }
                    }

                    headline.Append(" [" + disasterName + "]");
                    headline.Append(" 발령");

                    if (this.RefType == OrderReferenceType.Cancel)
                    {
                        headline.Append(" 취소");
                    }
                }

                return(association + headline.ToString());
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("[OrderInfo] GetHeadlineString( Exception=[" + ex.ToString() + "] )");
                FileLogManager.GetInstance().WriteLog("[OrderInfo] GetHeadlineString ( Exception=[" + ex.ToString() + "] )");

                return(string.Empty);
            }
        }