コード例 #1
0
 public override void FormOnLoad()
 {
     customerService      = new CustomerService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));
     customerClassService = new CustomerClassService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));
     this.DataGridViewOnLoad(dgvCustomer);
     BindData(true);
 }
コード例 #2
0
        private bool CheckInputValidate()
        {
            if (!this.txtOriginalPassword.Text.Trim().Equals(SecretHelper.AESDecrypt(UserInfo.Password.Trim())))
            {
                MessageBoxHelper.ShowErrorMsg(RDIFrameworkMessage.MSG9967);
                txtOriginalPassword.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(this.txtNewPassword.Text.Trim()))
            {
                MessageBoxHelper.ShowWarningMsg("新密码不能为空!");
                txtNewPassword.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(txtConfirmPassword.Text.Trim()))
            {
                MessageBoxHelper.ShowWarningMsg("确认密码不能为空!");
                txtConfirmPassword.Focus();
                return(false);
            }

            if (!txtNewPassword.Text.Trim().Equals(txtConfirmPassword.Text.Trim()))
            {
                MessageBoxHelper.ShowWarningMsg("新密码与确认密码不一至!");
                txtConfirmPassword.Focus();
                return(false);
            }

            return(true);
        }
コード例 #3
0
        private void GetEntity(HttpContext ctx)
        {
            var entity = RDIFrameworkService.Instance.DbLinkDefineService.GetEntity(Utils.UserInfo, PublicMethod.GetString(getObj("key")));

            if (!string.IsNullOrEmpty(entity.LinkData))
            {
                entity.LinkData = SecretHelper.AESDecrypt(entity.LinkData);
            }
            ctx.Response.Write(JSONhelper.ToJson(entity));
        }
コード例 #4
0
        public override void FormOnLoad()
        {
            linkMainService = new LinkManService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));

            BindCategory();
            this.Text = "新增联系人";
            if (!string.IsNullOrEmpty(currentLinkManId))
            {
                this.btnSaveContine.Visible = false;
                this.Text = "编辑联系人 - " + currentLinkManName;
                BindEditData();
            }
        }
コード例 #5
0
        public override void ShowEntity()
        {
            currentDblinkDefine = RDIFrameworkService.Instance.DbLinkDefineService.GetEntity(this.UserInfo, this.EntityId);
            if (currentDblinkDefine == null)
            {
                return;
            }

            this.txtLinkName.Text    = currentDblinkDefine.LinkName;
            this.cboLinkType.Text    = currentDblinkDefine.LinkType;
            this.chkEnabled.Checked  = BusinessLogic.ConvertIntToBoolean(currentDblinkDefine.Enabled);
            this.txtDescription.Text = currentDblinkDefine.Description;
            this.txtDbLinks.Text     = SecretHelper.AESDecrypt(currentDblinkDefine.LinkData);
        }
コード例 #6
0
 public override void FormOnLoad()
 {
     customerService      = new CustomerService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));
     customerClassService = new CustomerClassService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));
     linkMainService      = new LinkManService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));
     BindTree(true);
     BindCategory();
     this.Text = "新增用户";
     if (!string.IsNullOrEmpty(currentCustomerId))
     {
         this.btnSaveContine.Visible = false;
         this.Text = "编辑用户 - " + currentCustomerName;
         BindEditData();
     }
 }
コード例 #7
0
        /// <summary>
        /// 获取现有的登录信息
        /// </summary>
        private void GetLogOnInfo()
        {
            if (this.chkRememberPassword.Checked)
            {
                this.txtUserName.Text = SystemInfo.CurrentUserName;

                // 对密码进行解密操作
                string password = SystemInfo.CurrentPassword;
                if (SystemInfo.EncryptClientPassword)
                {
                    password = SecretHelper.AESDecrypt(password);
                }
                this.txtPassword.Text = password;

                // 写入注册表信息,这个往往是会遇到安全问题,出现异常等

                /*
                 * RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"Software\" + BaseConfiguration.COMPANY_NAME + "\\" + SystemInfo.SoftName, false);
                 * if (registryKey != null)
                 * {
                 *  // 这里是保存用户名的读取,对用户名进行解密操作
                 *  string userName = (string)registryKey.GetValue(BaseConfiguration.CURRENT_USERNAME);
                 *  userName = SecretUtil.Decrypt(userName);
                 *  DataRowView dataRowView = null;
                 *  for (int i = 0; i < this.cmbUser.Items.Count; i++)
                 *  {
                 *      dataRowView = (DataRowView)this.cmbUser.Items[i];
                 *      if (dataRowView[BaseUserEntity.FieldUserName].ToString().Equals(userName))
                 *      {
                 *          this.cmbUser.SelectedIndex = i;
                 *          // this.cmbUser.SelectedItem = this.cmbUser.Items[i];
                 *          // this.cmbUser.SelectedValue = userName;
                 *          break;
                 *      }
                 *  }
                 *  // 对密码进行解密操作
                 *  string password = (string)registryKey.GetValue(BaseConfiguration.CURRENT_PASSWORD);
                 *  password = SecretUtil.Decrypt(password);
                 *  this.txtPassword.Text = password;
                 * }
                 */
            }
            //this.chbAutoLogOn.Checked = SystemInfo.AutoLogOn;
        }
コード例 #8
0
    /// <summary>
    /// 检查当前的Cookie内容
    /// </summary>
    /// <param name="httpRequest">当前页</param>
    /// <returns>Cookie内容</returns>
    public static UserInfo CheckCookie(HttpRequest httpRequest)
    {
        UserInfo userInfo = null;
        string   password = string.Empty;
        // 取得cookie的保存信息
        HttpCookie httpCookie = httpRequest.Cookies[Utils.CookieName];

        if (httpCookie == null)
        {
            return(userInfo);
        }
        // 读取用户名
        if (!string.IsNullOrEmpty(httpCookie.Values[Utils.CookieUserName]))
        {
            string username = httpCookie.Values[Utils.CookieUserName].ToString();
            if (string.IsNullOrEmpty(SystemInfo.RDIFrameworkDbConection))
            {
                // 若没有能连接数据库,就直接从Cookie读取用户,这里应该重新定位一下用户信息那里,判断用户是否有效等等,密码是否修改了等等。
                userInfo = GetUserCookie(httpRequest);
            }
            else
            {
                if (SystemInfo.RememberPassword)
                {
                    // 读取密码
                    if (!string.IsNullOrEmpty(httpCookie.Values[Utils.CookiePassword]))
                    {
                        password = SecretHelper.AESDecrypt(httpCookie.Values[Utils.CookiePassword].ToString());
                    }
                    // 进行登录,这里是靠重新登录获取Cookie
                    userInfo = LogOn(username, password, false);
                }
            }
        }
        return(userInfo);
    }
コード例 #9
0
 public override void FormOnLoad()
 {
     incomingCallService = new IncomingCallService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));
     this.DataGridViewOnLoad(dgvInfo);
     GetList();
 }
コード例 #10
0
 public override void FormOnLoad()
 {
     //得到数据提供者(指定数据库类型【默认为:MsSqlserver】与数据库连接字符串【解密后】)
     dbProvider = DbFactoryProvider.GetProvider(DbLinks["ProductDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["ProductDBLink"].DbLink));
     BindCategory();
     //userConstraintExpress = RDIFrameworkService.Instance.TableColumnsService.GetConstraint(this.UserInfo, PiUserTable.TableName, this.UserInfo.Id, ProductInfoTable.TableName); //按表约束条件获得数据(按当前用户)。
     userConstraintExpress = RDIFrameworkService.Instance.TableColumnsService.GetUserConstraint(this.UserInfo, ProductInfoTable.TableName); //按表约束条件获得数据(得到用户与角色的约束条件)。
     //绑定数据
     this.Search();
 }
コード例 #11
0
 public override void FormOnLoad()
 {
     linkMainService = new LinkManService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));
     this.DataGridViewOnLoad(dgvLinkMain);
     this.GetLinkManData();
 }
コード例 #12
0
        private void GetPreviewData()
        {
            Cursor holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            var recordCount = 0;
            QueryEngineDefineEntity queryEngineDefineEntity = RDIFrameworkService.Instance.QueryEngineService.GetQueryEngineDefineEntity(this.UserInfo, this.EntityId);
            CiDbLinkDefineEntity    dblinkEntity            = null;
            IDbProvider             dbProvider = null;

            if (queryEngineDefineEntity != null && !string.IsNullOrEmpty(queryEngineDefineEntity.DataBaseLinkName))
            {
                dblinkEntity = RDIFrameworkService.Instance.DbLinkDefineService.GetEntity(this.UserInfo, queryEngineDefineEntity.DataBaseLinkName);
            }

            if (dblinkEntity != null)
            {
                var DbDefine = RDIFrameworkService.Instance.DbLinkDefineService.GetEntityByLinkName(this.UserInfo, dblinkEntity.LinkName);
                dbProvider = DbDefine != null?DbFactoryProvider.GetProvider((CurrentDbType)Enum.Parse(typeof(CurrentDbType), DbDefine.LinkType, true), SecretHelper.AESDecrypt(DbDefine.LinkData))
                                 : DbFactoryProvider.GetProvider(SystemInfo.BusinessDbType, SystemInfo.BusinessDbConnectionString);

                var dtDynamicJsonDt = dbProvider.GetDTByPage(out recordCount, queryEngineDefineEntity.QueryString, ucPagerEx1.PageIndex, ucPagerEx1.PageSize, string.Empty, queryEngineDefineEntity.OrderByField);
                ucPagerEx1.RecordCount = recordCount;
                ucPagerEx1.InitPageInfo();
                this.dgvListSample.AutoGenerateColumns = true;
                this.dgvListSample.DataSource          = dtDynamicJsonDt.DefaultView;
            }
            else
            {
                ucPagerEx1.RecordCount = 0;
                ucPagerEx1.InitPageInfo();
                this.dgvListSample.AutoGenerateColumns = true;
                this.dgvListSample.DataSource          = null;
            }

            this.Cursor = holdCursor;
        }
コード例 #13
0
        private void BindData()
        {
            /**********************************************************
            * 一、客户端配置
            **********************************************************/
            EncryptClientPassword.Checked = SystemInfo.EncryptClientPassword;
            AutoLogOn.Checked             = SystemInfo.AutoLogOn;
            RememberPassword.Checked      = SystemInfo.RememberPassword;
            LoadAllUser.Checked           = SystemInfo.LoadAllUser;
            EncryptDbConnection.Checked   = SystemInfo.EncryptDbConnection;
            ServiceUserName.Text          = SystemInfo.ServiceUserName;
            ServicePassword.Text          = SystemInfo.ServicePassword;
            RDIFrameworkDbType.Text       = SystemInfo.RDIFrameworkDbType.ToString();
            //zh-CN,zh-TW,en-US
            switch (SystemInfo.CurrentLanguage)
            {
            case "zh-CN":
                CurrentLanguage.SelectedItem = CurrentLanguage.Items[0];
                break;

            case "zh-TW":
                CurrentLanguage.SelectedItem = CurrentLanguage.Items[1];
                break;

            case "en-US":
                CurrentLanguage.SelectedItem = CurrentLanguage.Items[2];
                break;
            }
            RDIFrameworkDbConection.Text = SystemInfo.RDIFrameworkDbConectionString;
            if (SystemInfo.EncryptDbConnection)
            {
                RDIFrameworkDbConection.Text = SecretHelper.AESDecrypt(SystemInfo.RDIFrameworkDbConectionString);
            }

            /**********************************************************
            * 二、服务端配置
            **********************************************************/
            AllowUserToRegister.Checked             = SystemInfo.AllowUserToRegister;
            EnableRecordLog.Checked                 = SystemInfo.EnableRecordLog;
            EnableCheckIPAddress.Checked            = SystemInfo.EnableCheckIPAddress;
            EnableUserAuthorizationScope.Checked    = SystemInfo.EnableUserAuthorizationScope;
            EnableUserAuthorization.Checked         = SystemInfo.EnableUserAuthorization;
            EnableModulePermission.Checked          = SystemInfo.EnableModulePermission;
            EnablePermissionItem.Checked            = SystemInfo.EnablePermissionItem;
            EnableTableFieldPermission.Checked      = SystemInfo.EnableTableFieldPermission;
            EnableTableConstraintPermission.Checked = SystemInfo.EnableTableConstraintPermission;
            EnableEncryptServerPassword.Checked     = SystemInfo.EnableEncryptServerPassword;
            EnableCheckPasswordStrength.Checked     = SystemInfo.EnableCheckPasswordStrength;
            NumericCharacters.Checked               = SystemInfo.NumericCharacters;
            CheckOnLine.Checked = SystemInfo.CheckOnLine;
            EnableOrganizePermission.Checked = SystemInfo.EnableOrganizePermission;
            OnLineLimit.Value            = SystemInfo.OnLineLimit;
            OnLineTime0ut.Value          = SystemInfo.OnLineTime0ut;
            AccountMinimumLength.Value   = SystemInfo.AccountMinimumLength;
            PasswordChangeCycle.Value    = SystemInfo.PasswordChangeCycle;
            PasswordErrorLockLimit.Value = SystemInfo.PasswordErrorLockLimit;
            PasswordErrorLockCycle.Value = SystemInfo.PasswordErrorLockCycle;
            DefaultPassword.Text         = SystemInfo.DefaultPassword;
            PasswordMiniLength.Value     = SystemInfo.PasswordMiniLength;
            //**********************************************************
            //三、系统参数配置
            //**********************************************************
            MainForm.SelectedValue = SystemInfo.MainForm;
            foreach (DevComponents.Editors.ComboItem cboItem in MainForm.Items)
            {
                if (SystemInfo.MainForm == cboItem.Text)
                {
                    MainForm.SelectedItem = cboItem;
                    break;
                }
            }
            LogOnForm.Text           = SystemInfo.LogOnForm;
            LogOnAssembly.Text       = SystemInfo.LogOnAssembly;
            CustomerCompanyName.Text = SystemInfo.CustomerCompanyName;
            ConfigurationFrom.Text   = SystemInfo.ConfigurationFrom.ToString();
            SoftName.Text            = SystemInfo.SoftName;
            SoftFullName.Text        = SystemInfo.SoftFullName;
            Version.Text             = SystemInfo.Version;
            Service.Text             = SystemInfo.Service;
            RegisterKey.Text         = SystemInfo.RegisterKey;
            //**********************************************************
            //四、错误报告反馈配置
            //**********************************************************
            ErrorReportFrom.Text         = SystemInfo.ErrorReportFrom;
            ErrorReportMailUserName.Text = SystemInfo.ErrorReportMailUserName;
            ErrorReportMailServer.Text   = SystemInfo.ErrorReportMailServer;
            ErrorReportMailPassword.Text = SystemInfo.ErrorReportMailPassword;
        }
コード例 #14
0
 public override void FormOnLoad()
 {
     dbProvider = DbFactoryProvider.GetProvider(DbLinks["RDIFrameworkDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["RDIFrameworkDBLink"].DbLink));
     BindCategory();
     this.ProductCode.Text = BusinessLogic.NewGuid();
     //修改数据
     if (!string.IsNullOrEmpty(this.EntityId))
     {
         BindEditData();
         this.Text = "编辑产品 - " + currentProductInfoEntity.ProductName;
         this.btnSaveContine.Visible = false;
     }
 }
コード例 #15
0
        public override void FormOnLoad()
        {
            incomingCallService = new IncomingCallService(DbLinks["CRMDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["CRMDBLink"].DbLink));

            if (!string.IsNullOrEmpty(this.EntityId))
            {
                this.btnSaveContine.Visible = false;
                this.Text = "来电修改";
                BindEditData();
            }
            this.txtCallRecord.Focus();
        }
コード例 #16
0
 private void FrmTestDgvSummary_Load(object sender, EventArgs e)
 {
     dbProvider = DbFactoryProvider.GetProvider(DbLinks["ProductDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["ProductDBLink"].DbLink));
     BindData();
 }
コード例 #17
0
        /// <summary>
        /// 按查询引擎主键列表得到对应的查询引擎定义列表
        /// </summary>
        private void GetDynamicJsonByQueryEngineDefineId(HttpContext context)
        {
            try
            {
                var queryEngineDefineId = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("queryEngineDefineId"));
                int pageSize            = Convert.ToInt32(WebCommon.StringHelper.GetRequestObject("pageSize"));
                int pageIndex           = Convert.ToInt32(WebCommon.StringHelper.GetRequestObject("pageNumber"));
                //排序字段
                string sortName = RDIFramework.Utilities.BusinessLogic.ConvertToString(WebCommon.StringHelper.GetRequestObject("sort"));
                //排序方式
                string sortType = RDIFramework.Utilities.BusinessLogic.ConvertToString(WebCommon.StringHelper.GetRequestObject("order"));

                var where = "";
                var filters = RDIFramework.Utilities.BusinessLogic.ConvertToString(WebCommon.StringHelper.GetRequestObject("filter"));
                if (!string.IsNullOrEmpty(filters))
                {
                    string grouptype;
                    var    list = SearchFilter.GetSearchList(filters, out grouptype);
                    where = SearchFilter.ToSql(list, grouptype);
                }

                var      _pageindex  = pageIndex > 0 ? pageIndex : 1;
                var      _pagesize   = pageSize > 0 ? pageSize : 10;
                var      recordCount = 0;
                UserInfo vUser       = Utils.UserInfo;
                QueryEngineDefineEntity queryEngineDefineEntity = RDIFrameworkService.Instance.QueryEngineService.GetQueryEngineDefineEntity(vUser, queryEngineDefineId);
                CiDbLinkDefineEntity    dblinkEntity            = null;
                IDbProvider             dbProvider = null;
                if (queryEngineDefineEntity != null && !string.IsNullOrEmpty(queryEngineDefineEntity.DataBaseLinkName))
                {
                    dblinkEntity = RDIFrameworkService.Instance.DbLinkDefineService.GetEntity(vUser, queryEngineDefineEntity.DataBaseLinkName);
                }

                if (dblinkEntity != null)
                {
                    var DbDefine = RDIFrameworkService.Instance.DbLinkDefineService.GetEntityByLinkName(vUser, dblinkEntity.LinkName);
                    dbProvider = DbDefine != null?DbFactoryProvider.GetProvider((CurrentDbType)Enum.Parse(typeof(CurrentDbType), DbDefine.LinkType, true), SecretHelper.AESDecrypt(DbDefine.LinkData))
                                     : DbFactoryProvider.GetProvider(SystemInfo.BusinessDbType, SystemInfo.BusinessDbConnectionString);
                }

                var dtDynamicJsonDt = dbProvider.GetDTByPage(out recordCount, queryEngineDefineEntity.QueryString, _pageindex, _pagesize, string.Empty, queryEngineDefineEntity.OrderByField);


                var JsonData = new
                {
                    page  = _pageindex,
                    total = recordCount,
                    rows  = dtDynamicJsonDt
                };
                string returnJson = Newtonsoft.Json.JsonConvert.SerializeObject(JsonData);
                //{ "columns":"[[ {"field":"field1","title":"title1"},{...} ]]",data:[{page:"pageIndex",total:"totalNum",rows:[{name1:value,name2:value},{...}]}]}
                returnJson = "{\"columns\":" + CreateDataGridColumnModel(dtDynamicJsonDt) + ",\"data\":[" + returnJson + "]}";

                //TODO:待处理,处理异常情况(如:数据库连接失败等),前端应该提示
                context.Response.Write(returnJson);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }