Exemplo n.º 1
0
        //***********************************************************************************************
        #endregion

        #region 重写基类的方法

        public override void Init(IDBQuery dbHelper, IBizDataTransferCenter dataTransCenter, IStationInfo stationInfo, ILoginUser userData, IParameters parameters, ISysLog sysLog)
        {
            base.Init(dbHelper, dataTransCenter, stationInfo, userData, parameters, sysLog);
            //初始化ApplyControl
            applyControl.Init(_dbQuery, _dataTransCenter, _stationInfo, _userData, _parameters, _sysLog);
            SetButtonState(ButtonState.bsNormal);
        }
Exemplo n.º 2
0
        private void LoadDesign()
        {
            this.BackColor = Color.Transparent;

            if (_dataViewDesign != null)
            {
                IDBQuery curDBQuery = _dbQuery;

                if (string.IsNullOrEmpty(_dataViewDesign.DBSourceAlias) == false)
                {
                    string strErr = "";
                    curDBQuery = SqlHelper.GetThridDBHelper(_dataViewDesign.DBSourceAlias, _dbQuery, ref strErr);

                    if (curDBQuery == null)
                    {
                        MessageBox.Show("获取数据访问接口产生错误:" + strErr, "提示");
                        return;
                    }
                }

                dataViewLayout1.DBHelper      = _dbQuery;
                dataViewLayout1.ThridDBHelper = curDBQuery;

                dataViewLayout1.LoadLayout(_dataViewDesign.Items, _dataViewDesign.LayoutFmt);
            }
        }
Exemplo n.º 3
0
 public void Init(IDBQuery dbHelper, ILoginUser loginUser)
 {
     _dbHelper             = dbHelper;
     _rwm                  = new RoleWindowModel(_dbHelper);
     _loginUser            = loginUser;
     _departmentMatchModel = new DepartmentMatchModel(dbHelper);
 }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            try
            {
                ViewItemWrapper instance       = (context.Instance as ViewItemWrapper);
                Control         instanceParent = instance.Parent;

                while (instanceParent.Parent != null)
                {
                    instanceParent = instanceParent.Parent;

                    if (instanceParent as frmDataViewModuleDesign != null)
                    {
                        break;
                    }
                }

                IDBQuery dbHelper = null;
                string   sql      = "";
                if (instanceParent is frmDataViewModuleDesign)
                {
                    dbHelper = (instanceParent as frmDataViewModuleDesign).CurDBHelper;
                    sql      = (instanceParent as frmDataViewModuleDesign).CurSql;
                }


                //打开属性编辑器修改数据
                return(frmDataFieldEditor.EditValue(instanceParent, dbHelper, sql, value));
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex);
                return(null);
            }
        }
        public void Init(IDBQuery dbHelper, ILoginUser loginUser)
        {
            _dbHelper  = dbHelper;
            _loginUser = loginUser;

            _dbDicModel = new DictManageModel(_dbHelper);
        }
Exemplo n.º 6
0
        private void tsbTest_Click(object sender, EventArgs e)
        {
            try
            {
                IDBQuery curDBHelper = _dbHelper;

                if (string.IsNullOrEmpty(tsCbxDataSource.Text) == false)
                {
                    string strErr = "";
                    curDBHelper = SqlHelper.GetThridDBHelper(tsCbxDataSource.Text, _dbHelper, ref strErr);

                    if (curDBHelper == null)
                    {
                        MessageBox.Show("获取数据访问接口产生错误:" + strErr, "提示");
                        return;
                    }
                }

                queryDesigner1.ShowQuery(curDBHelper);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Exemplo n.º 7
0
 public void Init(IDBQuery dbHelper, ILoginUser loginUser)
 {
     _dbHelper  = dbHelper;
     _loginUser = loginUser;
     _bpm       = new BodypartModel(_dbHelper);
     _comboxEx  = new ComboxEx(dbHelper);
 }
        public void Init(IDBQuery dbHelper, ILoginUser loginUser)
        {
            _dbHelper  = dbHelper;
            _loginUser = loginUser;

            _hsm = new HisServerModel(_dbHelper);
        }
Exemplo n.º 9
0
        public void ShowTest(IDBQuery dbHelper, DataViewModuleDesign dataViewDesign, IWin32Window owner)
        {
            _dbHelper       = dbHelper;
            _dataViewDesign = dataViewDesign;

            this.ShowDialog(owner);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 判断指定的数据字段是否存在
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        public static bool HasDataField(string tableName, string fieldName)
        {
            IDBQuery  query = CFAspect.Resolve <IDBQuery>();
            DBBuilder sql   = DBBuilder.Select().Append(dbAdapter => "count(*) from " + dbAdapter.FormatFunction("getcolumns", dbAdapter.FormatValue(tableName)) + " where column_name=" + dbAdapter.FormatValue(fieldName));

            return(Convert.ToInt32(query.ToScalar(sql)) > 0);
        }
Exemplo n.º 11
0
        public void ShowDesign(BindDataSource dbSource, IDBQuery dbHelper, IWin32Window owner)
        {
            _dbSource = dbSource;
            _dbHelper = dbHelper;

            this.ShowDialog(owner);
        }
Exemplo n.º 12
0
        public void ShowDesign(InfoModuleDesign infoDesign, IDBQuery dbHelper, IWin32Window owner)
        {
            _infoDesign = infoDesign;
            _dbHelper   = dbHelper;

            this.ShowDialog(owner);
        }
Exemplo n.º 13
0
 public void Init(IDBQuery dbHelper, ILoginUser loginUser)
 {
     _dbHelper             = dbHelper;
     _qm                   = new QueueModel(_dbHelper);
     _loginUser            = loginUser;
     _departmentMatchModel = new DepartmentMatchModel(dbHelper);
 }
Exemplo n.º 14
0
 static public void ShowImgPreview(IDBQuery dbHelper, string applyId, IWin32Window owner)
 {
     using (frmImageView imgView = new frmImageView())
     {
         imgView.ShowImgPreview(dbHelper, applyId, owner);
     }
 }
Exemplo n.º 15
0
 public void Init(IDBQuery dbHelper, ILoginUser loginUser)
 {
     _dbHelper  = dbHelper;
     _loginUser = loginUser;
     _rwm       = new ReportWordsModel(_dbHelper);
     _comboxEx  = new ComboxEx(dbHelper);
 }
Exemplo n.º 16
0
        public bool ShowDesign(ApplySearchDesign applySearchDesign, IWin32Window owner, IDBQuery dbQuery)
        {
            _applySearchDesign = applySearchDesign;
            _dbQuery           = dbQuery;
            this.ShowDialog(owner);

            return(_isOk);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 测试查询
        /// </summary>
        /// <param name="dbHelper"></param>
        /// <returns></returns>
        public bool TestQuery(IDBQuery dbHelper)
        {
            string sql = qcReview.Query.TestSql();

            dbHelper.ExecuteSQL(sql);

            return(true);
        }
Exemplo n.º 18
0
        public static int Set(this IDBIO dbio, IDBQuery query)
        {
            QueryCompilation queryCompilation;

            queryCompilation = query.Compile();

            return(prv_set(dbio, queryCompilation.Query, queryCompilation.Parameters));
        }
Exemplo n.º 19
0
        private static IEnumerable <T> prv_get <T>(IDBIO dbio, IDBQuery query, Func <IDataRecord, T> buildDelegate)
        {
            QueryCompilation queryCompilation;

            queryCompilation = query.Compile();

            return(prv_get <T>(dbio, queryCompilation.Query, queryCompilation.Parameters, buildDelegate));
        }
Exemplo n.º 20
0
        public void ShowImgPreview(IDBQuery dbHelper, string applyId, IWin32Window owner)
        {
            _dbHelper = dbHelper;
            _applyId  = applyId;

            _studyMediaModel = new StudyMediaSerialModel(dbHelper);

            this.ShowDialog(owner);
        }
Exemplo n.º 21
0
        public void Init(IDBQuery dbHelper, ILoginUser loginUser)
        {
            _dbHelper  = dbHelper;
            _loginUser = loginUser;

            _um                   = new UserModel(_dbHelper);
            _comboxEx             = new ComboxEx(dbHelper);
            _departmentMatchModel = new DepartmentMatchModel(dbHelper);
        }
Exemplo n.º 22
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="dbHelper">数据库连接</param>
 private void Init(IDBQuery dbHelper)
 {
     _dbHelper = dbHelper;
     _eiModel  = new ExamItemModel(_dbHelper);
     _bpModel  = new BodypartModel(_dbHelper);
     InitBodypartList();
     InitModality();
     BindExamClassData();
 }
Exemplo n.º 23
0
        public void Init(IDBQuery dbHelper, ILoginUser loginUser)
        {
            _dbHelper = dbHelper;

            _pm  = new ParameterModel(_dbHelper);
            _nrm = new NoRuleModel(dbHelper);

            _loginUser = loginUser;
        }
Exemplo n.º 24
0
        private string _formatId   = ""; //格式ID

        public frmReportWordsConfig(IDBQuery dbHelper, string imgKind)
        {
            InitializeComponent();

            _dbHelper = dbHelper;
            _imgKind  = imgKind;

            _rwm = new ReportWordsModel(dbHelper);
        }
Exemplo n.º 25
0
        /// <summary>
        /// 编辑属性值
        /// </summary>
        /// <param name="designParent"></param>
        /// <param name="instance"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static object EditValue(Control designParent, IDBQuery dbHelper, string sql, object value)
        {
            using (frmDataFieldEditor form = new frmDataFieldEditor(dbHelper, sql, value))
            {
                form.ShowDialog(designParent);

                return(form.DataField);
            }
        }
Exemplo n.º 26
0
        public frmRequest(OraServices rsHis, IDBQuery dbHelper, ILoginUser userData)
        {
            _rsHis    = rsHis;
            _dbHelper = dbHelper;
            _userData = userData;

            InitializeComponent();
            init();
        }
Exemplo n.º 27
0
        private object GetDefaultValue(InputItem ii)
        {
            if (string.IsNullOrEmpty(ii.DefaultValue))
            {
                return(null);
            }

            if (ii.DefaultValue.IndexOf("[") < 0 && ii.DefaultValue.IndexOf("]") < 0)
            {
                return(ii.DefaultValue);
            }

            if (ii.DefaultValue.IndexOf("[SQL:") >= 0)
            {
                //sql语句处理
                IDBQuery thridDbHelper = _dbHelper;

                if (string.IsNullOrEmpty(ii.DBAlias) == false)
                {
                    string strErr = "";
                    thridDbHelper = SqlHelper.GetThridDBHelper(ii.DBAlias, _dbHelper, ref strErr);
                    if (thridDbHelper == null)
                    {
                        MessageBox.Show("录入项 [" + ii.Name + "] 对应的数据源不能创建。", "提示");
                        return(null);
                    }
                }

                if (thridDbHelper != null)
                {
                    string    sql      = "Select (" + ii.DefaultValue.Replace("[SQL:", "").Replace("]", "") + ") as Result from dual";
                    DataTable dtResult = thridDbHelper.ExecuteSQL(sql);

                    if (dtResult == null || dtResult.Rows.Count <= 0)
                    {
                        return(null);
                    }

                    return(dtResult.Rows[0]["Result"]);
                }
                else
                {
                    MessageBox.Show("尚未初始化数据查询对象。", "提示");
                    return(null);
                }
            }
            else if (ii.DefaultValue.IndexOf("[CS:") >= 0)
            {
                //csharp代码处理
                return(null);
            }
            else
            {
                return(ii.DefaultValue);
            }
        }
Exemplo n.º 28
0
        public bool ShowDataOperModuleDesign(IDBQuery dbHelper, DataOperModuleDesign dataOperDesign, IWin32Window owner)
        {
            _isOk           = false;
            _dataOperDesign = dataOperDesign;
            _dbHelper       = dbHelper;

            this.ShowDialog(owner);

            return(_isOk);
        }
Exemplo n.º 29
0
        public virtual void Init(IDBQuery dbHelper, ILoginUser userData, IStationInfo stationInfo, IBizDataTransferCenter parentTransferCenter)
        {
            _dbHelper    = dbHelper;
            _userData    = userData;
            _stationInfo = stationInfo;

            //初始化系统框架相关对象
            _dataTransCenter = new BizDataTransferCenter();
            _dataTransCenter.ParentDataCenter = parentTransferCenter;
        }
Exemplo n.º 30
0
        public DataBuffer(IDBQuery dataBase, string bufDir, string bufName)
            : base(bufDir, bufName)
        {
            if (dataBase == null)
            {
                throw new DBNullException();
            }

            _db = dataBase;
        }