Exemplo n.º 1
0
 public UserLogic(
     IUserEngine userEngine,
     IExceptionHandlerLogic exceptionHandlerLogic
     )
 {
     _userEngine            = userEngine;
     _exceptionHandlerLogic = exceptionHandlerLogic;
 }
Exemplo n.º 2
0
 public ManageController(
     IConfiguration config,
     IEmailSenderService emailSenderService,
     IUserEngine userEngine)
 {
     _config             = config;
     _userEngine         = userEngine;
     _config             = config;
     _emailSenderService = emailSenderService;
 }
Exemplo n.º 3
0
        /// <summary>
        /// 记录用户登录信息。
        /// </summary>
        /// <param name="userKey">用户主键。</param>
        /// <param name="site">站点。</param>
        /// <param name="language">语言。</param>
        /// <param name="version">系统版本号。</param>
        public void LogUserLoginInfo(string userKey, string site, string language, string version)
        {
            string preLoginLogKey = PropertyService.Get(PROPERTY_FIELDS.LOGIN_LOG_KEY);

            DataTable loginLogDataTable = RBAC_LOGIN_LOG_FIELDS.CreateDataTable();

            DataRow dataRow = loginLogDataTable.NewRow();

            string loginLogKey = CommonUtils.GenerateNewKey(0);

            dataRow[RBAC_LOGIN_LOG_FIELDS.FIELD_LOGIN_LOG_KEY] = loginLogKey;
            dataRow[RBAC_LOGIN_LOG_FIELDS.FIELD_USER_KEY]      = userKey;
            dataRow[RBAC_LOGIN_LOG_FIELDS.FIELD_SITE]          = site;
            dataRow[RBAC_LOGIN_LOG_FIELDS.FIELD_LANGUAGE]      = language;
            dataRow[RBAC_LOGIN_LOG_FIELDS.FIELD_COMPUTER_NAME] = Environment.MachineName.ToString();
            dataRow[RBAC_LOGIN_LOG_FIELDS.FIELD_COMPUTER_IP]   = FanHai.Hemera.Utils.Common.Utils.GetLocationIPAddress();
            dataRow[RBAC_LOGIN_LOG_FIELDS.FIELD_VERSION]       = version;

            loginLogDataTable.Rows.Add(dataRow);

            loginLogDataTable.AcceptChanges();

            DataSet reqDS = new DataSet();

            reqDS.Tables.Add(loginLogDataTable);

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                IUserEngine       userEngine    = null;
                if (serverFactory != null)
                {
                    userEngine = serverFactory.CreateIUserEngine();
                }
                if (userEngine != null && !string.IsNullOrEmpty(preLoginLogKey))
                {
                    userEngine.LogUserLogoutInfo(preLoginLogKey);
                }

                if (userEngine != null && userEngine.LogUserLoginInfo(reqDS))
                {
                    PropertyService.Set(PROPERTY_FIELDS.LOGIN_LOG_KEY, loginLogKey);
                }
            }
            catch
            {
                //TODO: Ignore Generant Exception.
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Exemplo n.º 4
0
 public JSONController(
     UserManager <User> userManager,
     IProjectEngine projectEngine,
     IUserEngine userEngine,
     ICachingEx cachingEx,
     IHostingEnvironment environment
     )
 {
     _userManager   = userManager;
     _projectEngine = projectEngine;
     _userEngine    = userEngine;
     _cachingEx     = cachingEx;
     _environment   = environment;
 }
Exemplo n.º 5
0
 public ItemController(
     UserManager <User> userManager,
     IUserEngine userEngine,
     IProjectEngine projectEngine,
     INotificationService notificationService,
     ILogger logger,
     IContentEngine contentEngine
     ) : base(contentEngine)
 {
     _userManager         = userManager;
     _userEngine          = userEngine;
     _projectEngine       = projectEngine;
     _notificationService = notificationService;
     _logger = logger;
 }
Exemplo n.º 6
0
 public CampaignEngine(
     IUserEngine userEngine,
     teklifcepteDBContext dbContext,
     ICachingEx cachingEx,
     INotificationService notificationService,
     IConfiguration configuration,
     ILogger logger
     )
 {
     _userEngine          = userEngine;
     _dbContext           = dbContext;
     _cachingEx           = cachingEx;
     _notificationService = notificationService;
     _configuration       = configuration;
     _logger = logger;
 }
Exemplo n.º 7
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //对登陆界面的帐号密码进行判断并对XML 进行重新配置
            if (CheckData(this.txtUserName.Text.Trim(), this.txtPassword.Text.Trim()))
            {
                try
                {
                    CallRemotingService.SelectServerSite(site);
                    DataSet   ds        = new DataSet();
                    DataTable dataTable = CreateUserTable();//创建一张自定义结构的表
                    Dictionary <string, string> rowData = new Dictionary <string, string>()
                    {
                        { RBAC_USER_FIELDS.FIELD_USERNAME, txtUserName.Text.Trim() }
                    };
                    FanHai.Hemera.Utils.Common.Utils.AddRowDataToDataTable(ref dataTable, rowData); //把rowData中的数据添加在表dataTable中
                    ds.Tables.Add(dataTable);                                                       //把表dataTable添加到表集ds中
                    DataSet dataUser = new DataSet();

                    IServerObjFactory isof       = CallRemotingService.GetRemoteObject();//创建工厂接口对象
                    IUserEngine       userEngine = isof.CreateIUserEngine();

                    dataUser = userEngine.CheckUser(ds); //通过传入的帐号查询返回该帐号对应的信息

                    if (CheckUser(dataUser))             //数据库信息和用户信息进行对比返回bool类型
                    {
                        UpdateLanguageInfo();
                        UpdateServerSitList();
                        //对登录用户的信息进行登记
                        UpdateLoginUserInfo();

                        DialogResult = DialogResult.OK;
                        this.Close();
                        StatusBarService.SetCaretPosition(30, 70, 0);
                    }
                }
                catch (Exception ex)
                {
                    MessageService.ShowMessage(ex.Message);
                }
                finally
                {
                    CallRemotingService.UnregisterChannel();
                }
            }
            Xmlproper();
        }
 public AccountController(
     IHttpContextAccessor httpContextAccessor,
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     INotificationService notificationService,
     ILogger logger,
     IContentEngine contentEngine,
     IProjectEngine projectEngine,
     IUserEngine userEngine
     ) : base(contentEngine)
 {
     _httpContextAccessor = httpContextAccessor;
     _userManager         = userManager;
     _signInManager       = signInManager;
     _notificationService = notificationService;
     _projectEngine       = projectEngine;
     _userEngine          = userEngine;
     _logger = logger;
 }
Exemplo n.º 9
0
 public ProjectEngine(
     teklifcepteDBContext dbContext,
     ICachingEx cachingEx,
     INotificationService notificationService,
     IUserEngine userEngine,
     ICategoryServices categoryServices,
     IAdminEngine adminEngine,
     IConfiguration configuration,
     IHostingEnvironment environment
     )
 {
     _dbContext           = dbContext;
     _cachingEx           = cachingEx;
     _notificationService = notificationService;
     _userEngine          = userEngine;
     _categoryServices    = categoryServices;
     _adminEngine         = adminEngine;
     _configuration       = configuration;
     _environment         = environment;
 }
Exemplo n.º 10
0
 public UserRepository(IUserEngine Interface)
 {
     this.Interface = Interface;
 }
Exemplo n.º 11
0
        private void SMSApproveProcess(string FROM, string CONTENT, string TRANSID)
        {
            IWorkFlowResponseTokenQuery WorkFlowResponseTokenQuery = (IWorkFlowResponseTokenQuery)ContextRegistry.GetContext().GetObject("WorkFlowResponseTokenQuery");

            string ReplyApproveFlag = CONTENT.Equals(string.Empty) ? "" : CONTENT.Substring(CONTENT.Length - 1, 1);
            string ReplyTokenResult = CONTENT.Equals(string.Empty) ? "" : CONTENT.TrimEnd(new Char[] { 'Y', 'N', 'y', 'n' });


            if (ReplyApproveFlag.ToUpper().Equals("Y"))
            {
                ReplyApproveFlag = "Approve"; //Accept
            }
            else if (ReplyApproveFlag.ToUpper().Equals("N"))
            {
                ReplyApproveFlag = "Reject"; //Decline
            }
            long userID = 0;
            IList <WorkFlowResponseToken> responseTokens = WorkFlowResponseTokenQuery.FindByTokenCode(ReplyTokenResult);

            foreach (WorkFlowResponseToken responseToken in responseTokens)
            {
                userID = responseToken.UserID;
                break;
            }
            //1. SignIn by UserName (From)

            if (userID == 0)
            {
                //แจ้งเตือนในกรณีที่มีการ approved ผ่านมือถือ แต่ว่า approve อีกรอบจะทำให้ tokencode หาย
                long smsLogID = AddSMSLog(DateTime.Now, FROM, "Receive", CONTENT, TRANSID);
                SCGSMSService.SendSMS08(CONTENT, FROM, true);
            }
            else
            {
                try
                {
                    UserEngine = (IUserEngine)ContextRegistry.GetContext().GetObject("UserEngine");
                    ISuUserQuery      SuUserQuery      = (ISuUserQuery)ContextRegistry.GetContext().GetObject("SuUserQuery");
                    IDbParameterQuery DbParameterQuery = (IDbParameterQuery)ContextRegistry.GetContext().GetObject("DbParameterQuery");

                    SuUser user = SuUserQuery.FindByIdentity(userID);
                    if (user != null && user.MobilePhoneNo == FROM)
                    {
                        string userName = user.UserName;

                        UserEngine.SignIn(userName);

                        UserAccount = (IUserAccount)ContextRegistry.GetContext().GetObject("UserAccount");
                        string smsDefaultLanguageID = DbParameterQuery.GetParameterByName("SMSDefaultLanguageID");
                        UserAccount.CurrentLanguageID  = string.IsNullOrEmpty(smsDefaultLanguageID) ? (short)1 : Convert.ToInt16(smsDefaultLanguageID);
                        UserAccount.CurrentProgramCode = "SmsWcfService";


                        long smsLogID = AddSMSLog(DateTime.Now, FROM, "Receive", CONTENT, TRANSID);

                        bool approveFalg = CallWorkFlow(ReplyTokenResult, ReplyApproveFlag, FROM);
                    }
                    else
                    {
                        //แจ้งเตือนในกรณีที่มีการ approved ผ่านมือถือคนอื่นที่ไม่ใช่เครื่องที่รับ message นั้น
                        long smsLogID = AddSMSLog(DateTime.Now, FROM, "Receive", CONTENT, TRANSID);
                        SCGSMSService.SendSMS10(CONTENT, FROM, true);
                    }
                }
                catch (Exception ex)
                {
                    Utilities.WriteLogs(ex.Message, "smslog", "Logs", "txt");
                    // error = ex.Message;
                }
            }
        }
Exemplo n.º 12
0
 public CachedUserEngine(IUserEngine userEngine, ICacheProvider cacheProvider)
 {
     _userEngine    = userEngine;
     _cacheProvider = cacheProvider;
 }
Exemplo n.º 13
0
 public UserManager(IUserEngine userEngine)
 {
     this._userEngine = userEngine;
 }
 public AuthController(IUserEngine userEngine, IEmailEngine emailEngine)
 {
     _userEngine  = userEngine;
     _emailEngine = emailEngine;
 }
 public UserController(IUserEngine userEngine, IMapper mapper)
 {
     _userEngine = userEngine ?? throw new ArgumentNullException(nameof(userEngine));
     _mapper     = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
Exemplo n.º 16
0
 public LoginController(IUserEngine userEngine)
 {
     _userEngine = userEngine;
 }
Exemplo n.º 17
0
 public UserController(IUserEngine userEngine, IPropertyEngine proertyEngine)
 {
     _userEngine     = userEngine;
     _propertyEngine = proertyEngine;
 }
Exemplo n.º 18
0
 public UserLogic()
 {
     userEngine = new UserEngine();
 }
Exemplo n.º 19
0
 // using dependency injection to use the methods in IUserEngine
 public UserController(IUserEngine userEngine)
 {
     _userEngine = userEngine;
 }
 public AccountController(IOptions <LoginConfigModel> loginConfig, IUserEngine userEngine)
 {
     _loginConfig = loginConfig ?? throw new ArgumentNullException(nameof(loginConfig));
     _userEngine  = userEngine ?? throw new ArgumentNullException(nameof(userEngine));
 }
 //The UserEngineTests() constructor creates the MockedUserAccessor and passes it as the IUserAccessor argument into the UserEngine constructor
 public UserEngineTests()
 {
     mockedUserAccessor = new MockedUserAccessor();
     userEngine         = new UserEngine(mockedUserAccessor);
 }
Exemplo n.º 22
0
 public AuthController(IUserEngine userEngine)
 {
     _userEngine = userEngine;
 }
Exemplo n.º 23
0
 public HomeController(IUserEngine userEngine, ITritEngine tritEngine, ITritLikeEngine tritLikeEngine)
 {
     _userEngine     = userEngine;
     _tritEngine     = tritEngine;
     _tritLikeEngine = tritLikeEngine;
 }