Beispiel #1
0
        public DataTable GetSearchTopMenu()
        {
            Service.IResponse result;

            try
            {
                result = this.Core.Search(new DefaultMenuSearchModel()
                {
                    START_MENU_ID       = 0,
                    ONLY_PARENT_MENU_ID = 0
                });

                if (result.Status == Service.Status.OK && result.DataSet != null && result.DataSet.Tables.Count > 0)
                {
                    return(result.DataSet.Tables[1]);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
                //this.WindowsMessageBoxShow(Application.Current.Windows[0], ex);
                return(null);
            }
            finally
            {
            }
        }
        public DefaultTranslator()
        {
            ((ITranslator)this).Dictionary = new Dictionary <string, DataSet>();
            this.controls             = new Dictionary <System.Windows.Forms.Control, string>();
            this.dependencyObjects    = new Dictionary <DependencyObject, string>();
            this.SkipControlFullNames = new ArrayList();

            try
            {
                ((ITranslator)this).SourceCultureName = this.GetAttribute("SourceCultureName");
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
            }

            try
            {
                this.SkipControlFullNames.AddRange(this.GetAttribute("SkipControlFullNames").Split(','));
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
            }

            try
            {
                this.OtherLetterListBufferCount = this.GetAttributeInt("OtherLetterListBufferCount");
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
                this.OtherLetterListBufferCount = -1;
            }
        }
Beispiel #3
0
        private async void GetBackgroundImage()
        {
            try
            {
                this.refreshBackgroundImage = new ImageBrush(await this.Core.GetAttributeMediaWebImage("RefreshImage"));
                if (this.refreshBackgroundImage != null)
                {
                    this.NotifyPropertyChanged("RefreshBackgroundImage");
                }

                this.expendAllBackgroundImage = new ImageBrush(await this.Core.GetAttributeMediaWebImage("ExpendAllImage"));
                if (this.expendAllBackgroundImage != null)
                {
                    this.NotifyPropertyChanged("ExpendAllBackgroundImage");
                }

                this.collapseAllBackgroundImage = new ImageBrush(await this.Core.GetAttributeMediaWebImage("CollapseAllImage"));
                if (this.collapseAllBackgroundImage != null)
                {
                    this.NotifyPropertyChanged("CollapseAllBackgroundImage");

                    this.SearchCommand.Execute(null);
                }
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }
        }
Beispiel #4
0
        ServiceResult IServiceExtensions.Request(ServiceData serviceData)
        {
            ServiceResult serviceResult;

            //IService service;

            try
            {
                //service = (IService)this.CreateInstance("ServerAdapter");
                //_Service = (IService)Factory.CreateInstance(@"E:\Work\Project\Atomus\Service\ServerAdapter\bin\Debug\Atomus.Service.ServerAdapter.V1.0.0.0.dll", "Atomus.Service.ServerAdapter", true, true);

                serviceResult = new ServiceResult();
                serviceResult.ConvertServiceResult(((IService)this.CreateInstance("ServerAdapter")).Request((ServiceDataSet)serviceData.ServiceDataSet()));

                return(serviceResult);
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((ServiceResult)Factory.CreateInstance("Atomus.Service.ServiceResult", false, true, exception));
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((ServiceResult)Factory.CreateInstance("Atomus.Service.ServiceResult", false, true, exception));
            }
        }
Beispiel #5
0
        private void ReadSSO()
        {
            string SSOUser;
            string TimeKey;


            SSOUser = Config.Client.GetAttribute("UriParameter.SSOUser")?.ToString();
            TimeKey = Config.Client.GetAttribute("UriParameter.TimeKey")?.ToString();

            if (SSOUser != null && SSOUser.Length > 0 && TimeKey != null && TimeKey.Length > 0)
            {
                try
                {
                    DiagnosticsTool.MyTrace(new Exception(SSOUser));
                    Config.Client.SetAttribute("Sessionkey", Decrypt(HttpUtility.UrlDecode(SSOUser), TimeKey));
                }
                catch (Exception ex)
                {
                    DiagnosticsTool.MyTrace(ex);
                }
            }

            //if (Config.Client.GetAttribute("Sessionkey") != null)
            //    this.Bnt_Login_Click(this.Bnt_Login, null);
        }
Beispiel #6
0
        public ClientAdapter()
        {
            string tmp;

            this.Token = "";

            try
            {
                this.ByPassAll = this.GetAttributeBool("ByPassAll");
            }
            catch (Exception ex)
            {
                this.ByPassAll = true;
                DiagnosticsTool.MyTrace(ex);
            }

            try
            {
                if (!this.ByPassAll)
                {
                    tmp = this.GetAttribute("Authentication");

                    this.Authentication = tmp.Split(',');
                }
            }
            catch (Exception ex)
            {
                this.Authentication = null;
                DiagnosticsTool.MyTrace(ex);
            }
        }
Beispiel #7
0
        Response IServiceClient.Request(IServiceDataSet serviceDataSet)
        {
            ICore core;

            //IService service;
            //IResponse response;

            try
            {
                //service = (IService)this.CreateInstance("Service");
                //core = (IService)Factory.CreateInstance(@"E:\Work\Project\Atomus\Service\WcfServiceClient\bin\Debug\Atomus.Service.WcfServiceClient.V1.0.0.0.dll", "Atomus.Service.WcfServiceClient", true, true);

                core = this.CreateInstance("Service");

                if (core is IService)
                {
                    return(this.RequestServiceDataSet(core, serviceDataSet));
                }
                else
                {
                    return(this.RequestServiceData(core, serviceDataSet));
                }
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((Response)Factory.CreateInstance("Atomus.Service.Response", false, true, exception));
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((Response)Factory.CreateInstance("Atomus.Service.Response", false, true, exception));
            }
        }
Beispiel #8
0
        /// <summary>
        /// 서비스 가져오기
        /// 사용 가능한 서비스가 없으면 신규로 생성해서 가져 온다
        /// </summary>
        /// <returns></returns>
        private ServiceExtensionsInfo GetService()
        {
            var service = from Tmp in this.listServicePool
                          where Tmp.IsBusy.Equals(false)
                          select Tmp;

            if (service.Count() == 0)
            {
                if (this.listServicePool.Count() >= this.servicePoolMaxCount)
                {
                    DiagnosticsTool.MyTrace(new AtomusException("서비스 풀이 가득 찼습니다."));

                    return(this.listServicePool[0]);
                }
                else
                {
                    this.CreateService();
                    return(this.GetService());
                }
            }
            else
            {
                return(service.First());
            }
        }
        public ModernLoginViewModel(ICore core) : this()
        {
            this.Core = core;

            try
            {
                if (this.Core.GetAttribute("EnableJoin") != null && this.Core.GetAttribute("EnableJoin").Equals("Y"))
                {
                    this.joinVisibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    this.joinVisibility = System.Windows.Visibility.Hidden;
                }

                this.GetBackgroundImage();
                this.SetLanguageList();
                this.ReadSSO();

                this.isEnabledIsEmailSaveControl = true;
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
                //this.WindowsMessageBoxShow(Application.Current.Windows[0], ex);
            }
        }
Beispiel #10
0
        async Task <Response> RequestServiceDataAsync(ICore core, IServiceDataSet serviceDataSet)
        {
            ServiceData   serviceData;
            ServiceResult serviceResult;

            try
            {
                serviceData = new ServiceData();

                if (this.ByPassAll)//무조건 처리
                {
                    serviceData.ConvertServiceData(serviceDataSet);

                    serviceResult = await((dynamic)core).RequestAsync(serviceData);

                    return((Response)serviceResult.Response());
                }
                else
                {
                    if (this.Authentication != null && this.Authentication.Length == 2 &&
                        serviceDataSet.DataTables.Contains(this.Authentication[0]) &&
                        serviceDataSet[this.Authentication[0]].CommandText.Contains(this.Authentication[1]))   //로그인이 정적으로 처리 되면 토큰을 저장한다
                    {
                        serviceData.ConvertServiceData(serviceDataSet);

                        serviceResult = await((dynamic)core).RequestAsync(serviceData);

                        if (serviceResult.Status == Status.OK)
                        {
                            this.Token            = serviceResult.Message;
                            serviceResult.Message = null;
                        }

                        return((Response)serviceResult.Response());
                    }

                    //토큰을 매번 보낸다
                    serviceDataSet["Token"].ConnectionName = "Atomus";
                    serviceDataSet["Token"].CommandText    = this.Token;

                    serviceData.ConvertServiceData(serviceDataSet);

                    serviceResult = await((dynamic)core).RequestAsync(serviceData);

                    return((Response)serviceResult.Response());
                }
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((Response)Factory.CreateInstance("Atomus.Service.Response", false, true, exception));
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((Response)Factory.CreateInstance("Atomus.Service.Response", false, true, exception));
            }
        }
        private void LoadDictionary(string sourceCultureName, string targetCultureName)
        {
            IResponse result;
            DataTable dataTable;
            DataSet   dataSet;

            try
            {
                if (sourceCultureName == targetCultureName || sourceCultureName == null || targetCultureName == null)
                {
                    return;
                }

                //if (sourceCultureName == null || targetCultureName == null)
                //    return;

                result = this.Search(new Control.Localization.Models.DefaultTranslatorSearchModel()
                {
                    SOURCE_LANGUAGE_TYPE = sourceCultureName,
                    TARGET_LANGUAGE_TYPE = targetCultureName
                });

                if (result.Status == Status.OK)
                {
                    if (result.DataSet.Tables.Count < 1)
                    {
                        return;
                    }

                    if (!((ITranslator)this).Dictionary.ContainsKey(sourceCultureName))
                    {
                        dataSet = new DataSet();
                        ((ITranslator)this).Dictionary.Add(sourceCultureName, dataSet);
                    }

                    dataSet = ((ITranslator)this).Dictionary[sourceCultureName];

                    if (!dataSet.Tables.Contains(targetCultureName))
                    {
                        dataTable = result.DataSet.Tables[0];
                        result.DataSet.Tables.Remove(dataTable);
                        dataTable.TableName = targetCultureName;

                        dataSet.Tables.Add(dataTable);
                    }
                }
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }
        }
Beispiel #12
0
        Response RequestServiceData(ICore core, IServiceDataSet serviceDataSet)
        {
            ServiceData serviceData;
            IResponse   response;

            try
            {
                serviceData = new ServiceData();

                if (this.ByPassAll)//무조건 처리
                {
                    serviceData.ConvertServiceData(serviceDataSet);

                    return((Response)((IServiceExtensions)core).Request(serviceData).Response());
                }
                else
                {
                    if (this.Authentication != null && this.Authentication.Length == 2 &&
                        serviceDataSet.DataTables.Contains(this.Authentication[0]) &&
                        serviceDataSet[this.Authentication[0]].CommandText.Contains(this.Authentication[1]))   //로그인이 정적으로 처리 되면 토큰을 저장한다
                    {
                        serviceData.ConvertServiceData(serviceDataSet);

                        response = ((IServiceExtensions)core).Request(serviceData).Response();

                        if (response.Status == Status.OK)
                        {
                            this.Token       = response.Message;
                            response.Message = null;
                        }

                        return((Response)response);
                    }

                    //토큰을 매번 보낸다
                    serviceDataSet["Token"].ConnectionName = "Atomus";
                    serviceDataSet["Token"].CommandText    = this.Token;

                    serviceData.ConvertServiceData(serviceDataSet);

                    return((Response)((IServiceExtensions)core).Request(serviceData).Response());
                }
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((Response)Factory.CreateInstance("Atomus.Service.Response", false, true, exception));
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
                return((Response)Factory.CreateInstance("Atomus.Service.Response", false, true, exception));
            }
            //return (Response)_Response;
        }
 private void SetStyleWindow(string skin, System.Windows.Style style, object key)
 {
     try
     {
         //style.Setters.Add(new Setter(Window.BackgroundProperty, new SolidColorBrush(this.GetAttributeMediaColor($"{skin}.DefaultBrowser.Background"))));
         //style.Setters.Add(new Setter(Window.ForegroundProperty, new SolidColorBrush(this.GetAttributeMediaColor($"{skin}.DefaultBrowser.Foreground"))));
     }
     catch (Exception exception)
     {
         DiagnosticsTool.MyTrace(exception);
     }
 }
Beispiel #14
0
 private void SetStyle()
 {
     try
     {
         //this.style = new Atomus.Windows.Style.ModernStyle(Application.Current.Resources);
         this.style = (ICore)this.CreateInstance("Style", true, true, new object[] { Application.Current.Resources });
     }
     catch (Exception ex)
     {
         DiagnosticsTool.MyTrace(ex);
     }
 }
        public ModernMenuViewModel(ICore core) : this()
        {
            this.Core = core;

            try
            {
                this.isEnabledControl = true;
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
            }
        }
        public TranslatorAdapter()
        {
            try
            {
                translator = (ITranslator)this.CreateInstance("Translator");
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
                translator = new NoneTranslator();
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
                translator = new NoneTranslator();
            }

            try
            {
                if (this.translator != null)
                {
                    ((ITranslator)this).Dictionary = translator.Dictionary;
                }
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }

            try
            {
                if (translator != null)
                {
                    translator.SourceCultureName = this.GetAttribute("SourceCultureName");
                }
            }
            catch (AtomusException exception)
            {
                DiagnosticsTool.MyTrace(exception);
                translator.SourceCultureName = CultureInfo.CurrentCulture.Name;
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
                translator.SourceCultureName = CultureInfo.CurrentCulture.Name;
            }
        }
        public DefaultWebBrowserViewModel(ICore core) : this()
        {
            this.Core = core;

            try
            {
                this.webBrowserUri = new Uri(this.Core.GetAttribute("DefaultUri"));
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
                //(this).WindowsMessageBoxShow(Application.Current.Windows[0], ex);
            }
        }
Beispiel #18
0
        public DefaultJoinViewModel(ICore core) : this()
        {
            this.Core = core;

            try
            {
                this.UserAgreement_Detail = this.Core.GetAttribute("UserAgreement");
                this.PersonalInformationCollectionAgreement_Detail = this.Core.GetAttribute("PersonalInformationCollectionAgreement");
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
            }
        }
        private void SetForm(double tmpWidth)
        {
            IDictionary dictionary;

            try
            {
                dictionary = (this as IDictionary);

                WidthCalculated = tmpWidth;
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }
        }
Beispiel #20
0
        public DefaultMenuViewModel(ICore core) : this()
        {
            this.Core = core;

            try
            {
                this.isEnabledControl = true;

                this.GetBackgroundImage();
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
            }
        }
        public ModernToolbarViewModel(ICore core) : this()
        {
            this.Core = core;

            try
            {
                this.backColor = this.Core.GetAttribute("BackColor");

                this.SetActionButtons();
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
            }
        }
        void ITranslator.Translate(System.Windows.Forms.Control control, string sourceCultureName, string targetCultureName)
        {
            if (control is System.Windows.Forms.ListControl)
            {
                return;
            }

            if (control is System.Windows.Forms.TextBoxBase)
            {
                return;
            }

            if (control is System.Windows.Forms.WebBrowserBase)
            {
                return;
            }

            if (control is System.Windows.Forms.WebBrowserBase)
            {
                return;
            }

            if (this.SkipControlFullNames.Contains(control.GetType().FullName))
            {
                return;
            }

            if (!this.controls.ContainsKey(control))
            {
                this.controls.Add(control, control.Text);
            }

            if (control.Controls != null && control.Controls.Count > 0)
            {
                ((ITranslator)this).Translate(control.Controls, sourceCultureName, targetCultureName);
            }

            //Text 속석을 사용 할 수 없는 컨트롤도 있음
            try
            {
                control.Text = ((ITranslator)this).Translate(this.controls[control], sourceCultureName, targetCultureName);
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }
        }
 async Task <string> IServiceStringAsync.RequestAsync(string data)
 {
     try
     {
         //return await ((dynamic)new WcfServiceClientString()).RequestAsync(data);
         return(await((dynamic)this.CreateInstance("Service")).RequestAsync(data));
     }
     catch (AtomusException exception)
     {
         DiagnosticsTool.MyTrace(exception);
         return(exception.ToString());
     }
     catch (Exception exception)
     {
         DiagnosticsTool.MyTrace(exception);
         return(exception.ToString());
     }
 }
 string IServiceString.Request(string data)
 {
     try
     {
         //return (new WcfServiceClientString() as IServiceString).Request(data);
         return((this.CreateInstance("Service") as IServiceString).Request(data));
     }
     catch (AtomusException exception)
     {
         DiagnosticsTool.MyTrace(exception);
         return(exception.ToString());
     }
     catch (Exception exception)
     {
         DiagnosticsTool.MyTrace(exception);
         return(exception.ToString());
     }
 }
 public Adapter()
 {
     if (messageBox == null)
     {
         try
         {
             messageBox = (IMessageBox)this.CreateInstance("MessageBox");
         }
         catch (AtomusException exception)
         {
             DiagnosticsTool.MyTrace(exception);
             messageBox = new WindowsMessageBox();
         }
         catch (Exception exception)
         {
             DiagnosticsTool.MyTrace(exception);
             messageBox = new WindowsMessageBox();
         }
     }
 }
Beispiel #26
0
        private async void GetBackgroundImage()
        {
            ImageSource image;

            try
            {
                image = await this.Core.GetAttributeMediaWebImage("BackgroundImage");

                this.backgroundImage = new ImageBrush(image);

                if (this.backgroundImage != null)
                {
                    (this.Core as IAction).ControlAction(this, new AtomusControlArgs("Form.Size", new System.Windows.Size(image.Width, image.Height)));
                }
            }
            catch (Exception exception)
            {
                DiagnosticsTool.MyTrace(exception);
            }
        }
Beispiel #27
0
        public DefaultMessage()
        {
            IResponse response;

            if (dataTable == null)
            {
                try
                {
                    response = this.Search();

                    if (response.Status == Status.OK)
                    {
                        dataTable = response.DataSet.Tables[0];
                    }
                }
                catch (Exception ex)
                {
                    DiagnosticsTool.MyTrace(ex);
                }
            }
        }
Beispiel #28
0
        private void SetLanguageList()
        {
            string[] tmps;

            try
            {
                this.languageList = new List <string>();

                var cultureNames = from Cultures in CultureInfo.GetCultures(CultureTypes.AllCultures)
                                   where Cultures.Name.Contains("-")
                                   orderby Cultures.Name
                                   select Cultures.Name;

                if (this.Core.GetAttribute("LanguageList") != null && this.Core.GetAttribute("LanguageList") != "")
                {
                    tmps = this.Core.GetAttribute("LanguageList").Split(',');

                    foreach (string name in tmps)
                    {
                        this.languageList.Add(name);
                    }
                }
                else
                {
                    foreach (string name in cultureNames)
                    {
                        this.languageList.Add(name);
                    }
                }

                this.languageList.Add("");
                //if (Properties.Settings.Default.Language.Equals(""))
                //    this.languageSelected = CultureInfo.CurrentCulture.Name;
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
                //this.WindowsMessageBoxShow(Application.Current.Windows[0], ex);
            }
        }
Beispiel #29
0
        private async void SearchProcess(decimal MENU_ID, decimal PARENT_MENU_ID)
        {
            Service.IResponse result;

            try
            {
                this.IsEnabledControl = false;
                (this.SearchCommand as Atomus.MVVM.DelegateCommand).RaiseCanExecuteChanged();

                result = await this.Core.SearchAsync(new DefaultMenuSearchModel()
                {
                    START_MENU_ID       = MENU_ID,
                    ONLY_PARENT_MENU_ID = PARENT_MENU_ID
                });

                if (result.Status == Service.Status.OK)
                {
                    this.MenuData = null;
                    if (result.DataSet != null && result.DataSet.Tables.Count > 0)
                    {
                        this.MenuData = await this.SetTree(result.DataSet.Tables[1]);
                    }
                }
                else
                {
                    this.WindowsMessageBoxShow(Application.Current.Windows[0], result.Message, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            catch (Exception ex)
            {
                DiagnosticsTool.MyTrace(ex);
                //this.WindowsMessageBoxShow(Application.Current.Windows[0], ex);
            }
            finally
            {
                this.IsEnabledControl = true;
                (this.SearchCommand as Atomus.MVVM.DelegateCommand).RaiseCanExecuteChanged();
            }
        }
        void ITranslator.Restoration(System.Windows.Forms.Control control)
        {
            if (this.controls.ContainsKey(control))
            {
                if (control.Controls != null && control.Controls.Count > 0)
                {
                    ((ITranslator)this).Restoration(control.Controls);
                }

                //Text 속석을 사용 할 수 없는 컨트롤도 있음
                try
                {
                    control.Text = this.controls[control];
                }
                catch (Exception _Exception)
                {
                    DiagnosticsTool.MyTrace(_Exception);
                }

                this.controls.Remove(control);
            }
        }