Ejemplo n.º 1
0
        public string LocalDateToInnovatorDate(DateTime date)
        {
            string convertedDate = date.ToString("u");
            // we need to pass a string to ConvertToNeutral
            DateTimeFormatInfo dtFormatInfo = new CultureInfo(innovatorInstance.getI18NSessionContext().GetLocale(), false).DateTimeFormat;

            // identify the format we are using
            convertedDate = innovatorInstance.getI18NSessionContext().ConvertToNeutral(convertedDate, "date", dtFormatInfo.UniversalSortableDateTimePattern);
            // return the new launch date in neutral format
            return(convertedDate);
        }
Ejemplo n.º 2
0
        //private class RollbackItem
        //{
        //    public string ItemType;
        //    public string ItemID;
        //}

        //private BackgroundWorker _backgroundWorker;

        //public ArasHelpers(BackgroundWorker backgroundWorker)
        //{
        //    _backgroundWorker = backgroundWorker;
        //}


        public static string ConvertDate(Innovator inn, java.util.Date msprojDate)
        {
            var cntx = inn.getI18NSessionContext();
            var dt   = msprojDate.ToDateTime();

            //var dv = new DateTime(msprojDate.getYear(), msprojDate.getMonth(), msprojDate.getDay());
            return(cntx.ConvertToNeutral(dt.ToShortDateString(), "date"));
        }
Ejemplo n.º 3
0
        public CAD2BOM(Innovator getInnovator)
        {
            //System.Diagnostics.Debugger.Break();

            innovator = getInnovator;
            conn      = innovator.getConnection();
            CbwGeneric.bwIOMInnovator = innovator;
            CoCommon = new CGeneric.Common();

            //Modify by kenny 2016/04/01 ------
            string LanCode = innovator.getI18NSessionContext().GetLanguageCode();

            if (LanCode == null)
            {
                LanCode = "";
            }
            LangCode = LanCode;
            LanCode  = LanCode.ToLower();

            if ((LanCode.IndexOf("zt") > -1) || (LanCode.IndexOf("tw") > -1))
            {
                LanCode = "zh-tw";
            }
            else if ((LanCode.IndexOf("zc") > -1) || (LanCode.IndexOf("cn") > -1))
            {
                LanCode = "zh-cn";
            }
            else if ((LanCode.IndexOf("kr") > -1) || (LanCode.IndexOf("ko") > -1))
            {
                LanCode = "ko-kr";
            }
            else
            {
                LanCode = "en";
            }
            CoCommon.SetLanguage   = LanCode;
            CbwGeneric.SetLanguage = LanCode;
            //----------------------------------
        }