Beispiel #1
0
 private string get_DbKodAdmin_Database(string _CustomerGuidId)
 {
     SIS.Data.App.GetValue _GetValue = SIS.Client.Admin.bl.get_GetValue();
     _GetValue.IdStr  = _CustomerGuidId;
     _GetValue.Id     = blvalue.AplicationId;
     _GetValue.ConStr = Client.blvalue.AppMain.AppValue.ConAdminFirst;
     SIS.Data.ReturnProcess _ReturnProcess = bl.blcAdmin.Run <Service.Admin.AdminService, SIS.Data.ReturnProcess>(r => r.get_DbKodAdmin_Database(_GetValue));
     return(_ReturnProcess.error);
 }
Beispiel #2
0
        public LoginUser Get_LoginUsersByCode(SIS.Data.App.GetValue _GetValue)
        {
            using (var _db = new GmpListContext(_GetValue.ConStr))
            {
                string _sql = $"SELECT UserCode,UserName,HashPassword from Users Where UserCode = N'{_GetValue.IdStr}'  ";

                var _return = _db.Database.SqlQuery <LoginUser>(_sql).FirstOrDefault();

                return(_return);
            }
        }
Beispiel #3
0
        private void Set_Form()
        {
            SIS.Data.App.GetValue _GetValue = SIS.Client.Admin.bl.get_GetValue();

            //if (!AppMain.AppValue.RunningLocalAdmin)
            //{
            //    SIS.Data.AppConfigs _AppConfigs = bl.blcAdmin.Run<SIS.Service.Admin.Service.AdminService, SIS.Data.AppConfigs>(r => r.get_AppConfigs());
            //}
            SIS.Data.App.AppIdView _AppIdView = new SIS.Data.App.AppIdView();
            if (SIS.Client.blvalue.AppMain.AppValue.GMPActive)
            {
                _AppIdView.Id  = (int)Data.AdminAppType.GMP;
                _AppIdView.App = Data.AdminAppType.GMP.ToString();
                SIS.Client.Admin.blvalue.List_AppIdView.Add(_AppIdView);
            }
            if (SIS.Client.blvalue.AppMain.AppValue.HTPActive)
            {
                _AppIdView     = new SIS.Data.App.AppIdView();
                _AppIdView.Id  = (int)Data.AdminAppType.HTP;
                _AppIdView.App = Data.AdminAppType.HTP.ToString();
                SIS.Client.Admin.blvalue.List_AppIdView.Add(_AppIdView);
            }
            if (AppMain.AppValue.APTActive)
            {
                _AppIdView     = new SIS.Data.App.AppIdView();
                _AppIdView.Id  = (int)Data.AdminAppType.APT;
                _AppIdView.App = Data.AdminAppType.APT.ToString();
                SIS.Client.Admin.blvalue.List_AppIdView.Add(_AppIdView);
            }
            if (AppMain.AppValue.GYMActive)
            {
                _AppIdView     = new SIS.Data.App.AppIdView();
                _AppIdView.Id  = (int)Data.AdminAppType.GYM;
                _AppIdView.App = Data.AdminAppType.GYM.ToString();
                SIS.Client.Admin.blvalue.List_AppIdView.Add(_AppIdView);
            }
            if (AppMain.AppValue.RACActive)
            {
                _AppIdView     = new SIS.Data.App.AppIdView();
                _AppIdView.Id  = (int)Data.AdminAppType.RAC;
                _AppIdView.App = Data.AdminAppType.RAC.ToString();
                SIS.Client.Admin.blvalue.List_AppIdView.Add(_AppIdView);
            }

            List <int> _List_ApplicationIds = new List <int>();

            _List_ApplicationIds.Add(blvalue.AplicationId);
            bs_AppIdView.DataSource = SIS.Client.Admin.blvalue.List_AppIdView;
        }
Beispiel #4
0
        private void set_DatabaseIdValue(int _DataBaseId)
        {
            if (__OldDatabaseId != _DataBaseId)
            {
                __OldDatabaseId = _DataBaseId;
            }
            else
            {
                return;
            }

            int _ServerId   = Convert.ToInt32(lc_serverList.EditValue);
            int _DatabaseId = Convert.ToInt32(lc_database.EditValue);

            var server = __List_ApplicationServer.Where(l => l.Id == _ServerId).FirstOrDefault().ApplicationDatabase.Where(l => l.Id == _DatabaseId).FirstOrDefault();

            __ConnectionString = server.ConnectionString;

            __Sql_Server   = __List_ApplicationServer.Where(l => l.Id == _ServerId).FirstOrDefault().Server;
            __Sql_User     = __List_ApplicationServer.Where(l => l.Id == _ServerId).FirstOrDefault().Username;
            __Sql_Password = __List_ApplicationServer.Where(l => l.Id == _ServerId).FirstOrDefault().Password;

            __Sql_Database = __List_ApplicationServer.Where(l => l.Id == _ServerId).FirstOrDefault().ApplicationDatabase.Where(l => l.Id == _DatabaseId).FirstOrDefault().DatabaseName;

            set_blvalue_ApiUrl((int)lc_serverList.EditValue);
            SIS.Data.App.GetValue _GetValue = SIS.Client.Admin.bl.get_GetValue();
            _GetValue.ConStr = __ConnectionString;

            _GetValue.IdStr = txt_userCode.Text;

            bl.AppService = AppServiceFactory.CreateApp((AdminAppType)blvalue.AplicationId);
            try
            {
                AppMain.List_UserCompanyRight  = bl.AppService.GetUserCompanyRights(_GetValue);
                bs_UserCompanyRight.DataSource = AppMain.List_UserCompanyRight;
            }
            catch (Exception _Exception)
            {
                bl.message.get_Warning(_Exception.InnerException == null ? _Exception.Message : _Exception.InnerException.Message, AppMain.AppValue.Language);
                txt_userCode.EditValue = "";
                txt_userCode.Focus();
            }
            finally
            {
                GetUsers(_GetValue);
            }
        }
Beispiel #5
0
        public ReturnProcess get_DbKodAdmin_Database(SIS.Data.App.GetValue _GetValue)
        {
            SIS.Data.ReturnProcess _ReturnProcess = new SIS.Data.ReturnProcess();
            try
            {
                //using (var _db = new SIS.DataAccess.Admin.AdminContext(_GetValue.ConStr))
                //{
                //    string _sql = $"Select Isnull(DbAdmin,'') from Customers Where GuidId = '{_GetValue.IdStr}' ";

                //    _ReturnProcess.error = _db.Database.SqlQuery<string>(_sql).FirstOrDefault();

                //}
                _ReturnProcess.processok = true;
            }
            catch (Exception exception)
            {
                _ReturnProcess.processok = false;
                _ReturnProcess.error     = exception.ToString();
            }
            return(_ReturnProcess);
        }
Beispiel #6
0
        public SIS.Data.ReturnProcess get_SqlData_Connect(SIS.Data.App.GetValue _GetValue)
        {
            SIS.Data.ReturnProcess _ReturnProcess = new ReturnProcess();
            try
            {
                using (var _db = new SIS.DataAccess.Admin.AdminListContext(_GetValue.ConStr))
                {
                    string _sql = "Select 1";
                    int    _int = _db.Database.SqlQuery <int>(_sql).FirstOrDefault();
                }

                _ReturnProcess.processok = true;
            }
            catch (Exception _Exception)
            {
                _ReturnProcess.processok = false;
                _ReturnProcess.error     = _Exception.InnerException == null ? _Exception.Message : _Exception.InnerException.Message;
            }


            return(_ReturnProcess);
        }
Beispiel #7
0
        private void set_DbAdmin_Database()
        {
            if (SIS.Client.blvalue.AppMain.AppValue.CloudLicense)
            {
                string _DbAdminDatabase = get_DbKodAdmin_Database(SIS.Client.blvalue.AppMain.AppValue.CustomerGuidId);
                if (_DbAdminDatabase == null)
                {
                    _DbAdminDatabase = "";
                }
                if (_DbAdminDatabase != "")
                {
                    SIS.Client.blvalue.AppMain.AppValue.DbAdminConnectionDTO.Database = _DbAdminDatabase;
                    string connection = SIS.Client.blvalue.AppMain.AppValue.DbAdminConnectionDTO.Connection(blvalue.Cloude);
                    #region Token
                    IAuthService        authService = new JWTService();
                    IAuthContainerModel model       = GetJWTContainerModel("connection", connection);

                    string token = authService.GenerateToken(model);
                    if (!string.IsNullOrEmpty(token))
                    {
                        connection = token;
                    }
                    #endregion

                    SIS.Client.blvalue.AppMain.AppValue.ConAdmin = connection;
                    SIS.Data.App.GetValue _GetValue = SIS.Client.Admin.bl.get_GetValue();
                    _GetValue.ConStr = SIS.Client.blvalue.AppMain.AppValue.ConAdmin;
                    //var result = bl.blcAdmin.Run<Service.Admin.Service.AdminService, SIS.Data.ReturnProcess>(r => r.UpdateSqlDatabase(_GetValue));
                }
                else
                {
                    string connection = SIS.Client.blvalue.AppMain.AppValue.AdminConnectionDTO.Connection(blvalue.Cloude);
                    SIS.Client.blvalue.AppMain.AppValue.ConAdmin = SIS.Client.blvalue.AppMain.CreateJwtToken("connection", connection);
                }
            }
        }
Beispiel #8
0
 public abstract List <SIS.Data.Admin.UserCompanyRight> GetUserCompanyRights(SIS.Data.App.GetValue _GetValue);