private string GetIAChangeTrigger(SourceTemplate sourceTemplate, string propertyName, FileCategory category)
        {
            if (category.Equals(FileCategory.HShareIPO) || category.Equals(FileCategory.IPO) || category.Equals(FileCategory.RIGHTS))
            {
                if ((propertyName + "").Trim().Length == 0)
                {
                    return(string.Empty);
                }
                else
                {
                    return("PEO");
                }
            }

            return(string.Empty);
        }
        private void FillQATemplate(List <List <string> > qaTemplate, SourceTemplate sourceTemplate, FileCategory category)
        {
            try
            {
                if (sourceTemplate == null)
                {
                    LogMessage("there is no data in the ParellelTrading source file.");
                    return;
                }

                List <List <string> > propertyName = GetPropertyName(qaTemplate);
                if (propertyName == null || propertyName.Count == 0)
                {
                    LogMessage("ParellelTrading is emptyt.");
                    return;
                }

                Dictionary <int, string> endString = new Dictionary <int, string>();
                endString.Add(0, ".HK");

                if (category.Equals(FileCategory.RIGHTS))
                {
                    endString.Add(1, "ta.HK");
                    //endString.Add(2, ".HS");
                }
                else
                {
                    endString.Add(1, "stat.HK");
                    endString.Add(2, "ta.HK");
                    endString.Add(3, ".HS");
                }

                int index;
                for (int i = 0; i < propertyName.Count; i++)
                {
                    for (int j = 0; j < propertyName[i].Count; j++)
                    {
                        index = GetIndex(i, j, propertyName);
                        qaTemplate[index][0] = string.Format("{0}{1}", GetQAUnderlying(sourceTemplate, category), endString[i]);
                        qaTemplate[index][2] = GetQAPropertyValue(sourceTemplate, propertyName[i][j], endString[i], category);
                        qaTemplate[index][3] = GetQAEffectiveDate(sourceTemplate, category);
                        qaTemplate[index][4] = GetQAEffectiveTo(propertyName[i][j], category);
                        qaTemplate[index][5] = GetQAChangeOffset(sourceTemplate, propertyName[i][j], category);
                        qaTemplate[index][6] = GetQAChangeTrigger(sourceTemplate, propertyName[i][j], category);
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("\r\n	     ClassName:  {0}\r\n	     MethodName: {1}\r\n	     Message:    {2}",
                                           System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(),
                                           System.Reflection.MethodBase.GetCurrentMethod().Name,
                                           ex.Message);
                Logger.Log(msg, Logger.LogType.Error);
            }
        }
        private string GetIAEffectiveTo(FileCategory category)
        {
            if (!category.Equals(FileCategory.RIGHTS))
            {
                return(string.Empty);
            }

            if ((configObj.EffectiveTo + "").Trim().Length == 0)
            {
                return(string.Empty);
            }

            return(configObj.EffectiveTo);
        }
        private string GetIADisplayname(SourceTemplate sourceTemplate, FileCategory category)
        {
            if (category.Equals(FileCategory.HShareIPO))
            {
                return(string.Format("{0} Ord Shs H", sourceTemplate.LegalRegisteredName.Replace("Company", "").Replace("Limited", "").Trim()));
            }

            if (category.Equals(FileCategory.IPO))
            {
                return(string.Format("{0} Ord Shs", sourceTemplate.LegalRegisteredName.Replace("Company", "").Replace("Limited", "").Trim()));
            }

            if (category.Equals(FileCategory.ParellelTrading))
            {
                return(string.Format("{0} Ord Shs (Temp)", sourceTemplate.LegalRegisteredName.Replace("Company", "").Replace("Limited", "").Trim()));
            }

            if (category.Equals(FileCategory.RIGHTS))
            {
                return(string.Format("{0} Rights", sourceTemplate.LegalRegisteredName.Replace("Company", "").Replace("Limited", "").Trim()));
            }

            return(string.Empty);
        }
        private string GetQADisplayname(SourceTemplate sourceTemplate, FileCategory category)
        {
            if (category.Equals(FileCategory.HShareIPO))
            {
                return(string.Format("{0} ORD H", sourceTemplate.Displayname.Replace("<--NOT YET CFM", "").Trim()));
            }

            if (category.Equals(FileCategory.IPO))
            {
                return(string.Format("{0} ORD", sourceTemplate.Displayname.Replace("<--NOT YET CFM", "").Trim()));
            }

            if (category.Equals(FileCategory.ParellelTrading))
            {
                return(string.Format("{0} ORD (TEMP)", sourceTemplate.Displayname.Replace("<--NOT YET CFM", "").Trim()));
            }

            if (category.Equals(FileCategory.RIGHTS))
            {
                return(sourceTemplate.Displayname.Replace("<--NOT YET CFM", "").Trim());
            }

            return(string.Empty);
        }
        private string GetQAChangeOffset(SourceTemplate sourceTemplate, string propertyName, FileCategory category)
        {
            if (category.Equals(FileCategory.RIGHTS))
            {
                if ((propertyName + "").Contains("RIC"))
                {
                    return("23");
                }
                else
                {
                    return(string.Empty);
                }
            }

            return(string.Empty);
        }
        private string GetQAEffectiveTo(string protyName, FileCategory category)
        {
            if (!category.Equals(FileCategory.RIGHTS))
            {
                return(string.Empty);
            }

            if ((configObj.EffectiveTo + "").Trim().Length == 0)
            {
                return(string.Empty);
            }

            if ((protyName + "").Trim().Length == 0 || (protyName + "").Trim().Equals("RIC"))
            {
                return(configObj.EffectiveTo);
            }

            return(string.Empty);
        }