Ejemplo n.º 1
0
 public static Campaign GetById(int id)
 {
     using (IDatabase db = new PetaPoco.Database(Settings.ConnectionString, providerName: "SqlServer"))
     {
         return(db.Single <Campaign>("WHERE Id = @0", id));
     }
 }
Ejemplo n.º 2
0
        public FrmEdtAddExt(Int64 id)
        {
            InitializeComponent();

            db = new Database("XE");
            _id = id;

            addHis = db.Single<ADDTION_CHECK_HISTORY_EXT>("where ID = @0", _id);
            aDDTIONCHECKHISTORYEXTBindingSource.DataSource = addHis;
        }
        private BSAMemberViewModel GetABSAMemberInternal(int iID)
        {
            //Connect to the Umbraco DB
            var db = new PetaPoco.Database(sConnectString);

            //Get an IENumberable of MeritBadges objects to iterate over
            var item = db.Single <BSAMember>(iID);

            return(FillViewModelBSAMember(item, true));
        }
Ejemplo n.º 4
0
        public FrmEdtAdd(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            addHis = db.Single<ADDTION_CHECK_HISTORY>("where ID = @0", _id);
            aDDTIONCHECKHISTORYBindingSource.DataSource = addHis;
        }
Ejemplo n.º 5
0
        public FrmEdtSln(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            sln = db.Single<RENAL_REPLACEMENT_THERAPY_HI>("where ID = @0", _id);
            rENALREPLACEMENTTHERAPYHIBindingSource.DataSource = sln;
        }
Ejemplo n.º 6
0
        public FrmEdtDose(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            doseHis = db.Single<DOSE_HISTORY>("where ID = @0", _id);
            dOSEHISTORYBindingSource.DataSource = doseHis;
        }
        public FrmEdtBloodCleanupProcess(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            process = db.Single<BLOODCLEANUP_PROCESS>("where ID = @0", _id);
            bLOODCLEANUPPROCESSBindingSource.DataSource = process;
        }
Ejemplo n.º 8
0
        public FrmEdtBody(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            bodyHis = db.Single<BODY_CHECK_HISTORY>("where ID = @0", _id);
            bODYCHECKHISTORYBindingSource.DataSource = bodyHis;
            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = 208");
        }
Ejemplo n.º 9
0
        public FrmEdtPath(Int64 id)
        {
            InitializeComponent();
            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            pathHis = db.Single<VASCULARPATH_HISTORY>("where ID = @0", _id);
            vASCULARPATHHISTORYBindingSource.DataSource = pathHis;

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = 193");
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = 194");
        }
Ejemplo n.º 10
0
        public Guid CreateUser(string email, string displayName, string passwordHash)
        {
            var db = new Database(_config.ConnectionString, "System.Data.SqlClient");
            var userId = (int)db.Insert("MR.tUser", "UserId", true, new
            {
                Email = email,
                Passwd = passwordHash,
                DisplayName = displayName,
                PasswdLastChange = DateTime.UtcNow
            });

            return db.Single<Guid>("select AuthId from MR.tUser where UserId = @0", userId);
        }
        public FrmEdtBloodCeanupBase(Int64 id)
        {
            InitializeComponent();

            ////string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            bloodCleanup = db.Single<BLOODCLEANUP>("where ID = @0", _id);
            bLOODCLEANUPBindingSource.DataSource = bloodCleanup;

            //EPOTextEdit.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            EPOTextEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("");
            EPOTextEdit.Properties.DisplayMember = "DSP_MEMBER";
            EPOTextEdit.Properties.ValueMember = "VALUE_MEMBER";

            MACH_TYPTextEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] {3});
            MACH_TYPTextEdit.Properties.DisplayMember = "DSP_MEMBER";
            MACH_TYPTextEdit.Properties.ValueMember = "VALUE_MEMBER";

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 101);
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 44);
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 102);
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 161);
            aCCOUNTBindingSource.DataSource = db.Fetch<ACCOUNT>("");

            bindingSource1.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 193);              // 通路类型
            bindingSource2.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 47);               // 管路
            bindingSource3.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 43);               // 穿刺针
            bindingSource4.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 171);              // 敷贴
            bindingSource5.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 166);              // 护理包
            bindingSource6.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 169);              // 肝素帽

            // 血管通路类型
            if (bloodCleanup.FISTULA_TYPE == 519 || bloodCleanup.FISTULA_TYPE == 520)
            {
                ItemForAPPLICATOR.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                ItemForAPPLICATOR_NUM.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                ItemForHEPARIN_CAP.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                ItemForHEPARIN_CAP_NUM.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
            else if (bloodCleanup.FISTULA_TYPE == 704 || bloodCleanup.FISTULA_TYPE == 705)
            {
                ItemForFISTULA_NEEDLE.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                ItemForFISTULA_NEEDLE_NUM.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                ItemForFISTULA_CARE_PACKAGES.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                ItemForFISTULA_CARE_PACKAGES_NUM.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
        }
Ejemplo n.º 12
0
        dynamic IStudent.GetStudent(int id)
        {
            var     entity     = _db.Single <entity.StudentEntity>(id);
            var     entityEx   = _db.Fetch <Student.entity.StudentEx>("select * from StudentExInfo where studentId=@0", entity.Id);
            dynamic retStudent = new ExpandoObject();

            retStudent.Id     = entity.Id;
            retStudent.IsHide = entity.IsHide;
            retStudent.Name   = entity.Name;
            foreach (var extItem in entityEx)
            {
                (retStudent as ICollection <KeyValuePair <string, object> >).Add(new KeyValuePair <string, object>(extItem.KeyName, extItem.KeyValue));
            }

            return(retStudent);
        }
Ejemplo n.º 13
0
        public FrmEdtInduce(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            induceHis = db.Single<INDUCEMENT_HISTORY>("select * from INDUCEMENT_HISTORY where ID = @0", _id);
            iNDUCEMENTHISTORYBindingSource.DataSource = induceHis;

            //INDUCEMENTTextEdit.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            INDUCEMENTTextEdit.Properties.DataSource = ClsFrmMng.lstIndecumentCode;
            INDUCEMENTTextEdit.Properties.DisplayMember = "INDUCEMENT_MEMO";
            INDUCEMENTTextEdit.Properties.ValueMember = "INDUCEMENT_MEMO";
        }
        public FrmEdtDiagonsis_Tumor(Int64 id)
        {
            InitializeComponent();
            db = new Database("XE");
            _id = id;

            //ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            //ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            //ruleNoEmpty.ErrorText = "该项不能为空。";
            //dxValidationProvider1.SetValidationRule(INFECTIOUS_DISEASETextEdit, ruleNoEmpty);

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 139);

            diag = db.Single<DIAGNOSIS_TUMOR>("where ID = @0", _id);
            dIAGNOSISTUMORBindingSource.DataSource = diag;
        }
        public FrmEdtPatient_Course_Sp(Int64 id)
        {
            InitializeComponent();
            db = new Database("XE");
            _id = id;

            //ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            //ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            //ruleNoEmpty.ErrorText = "该项不能为空。";
            //dxValidationProvider1.SetValidationRule(INFECTIOUS_DISEASETextEdit, ruleNoEmpty);

            //vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 137);

            v = db.Single<PATIENT_COURSE_SPECIAL>("where ID = @0", _id);
            pATIENTCOURSESPECIALBindingSource.DataSource = v;
        }
Ejemplo n.º 16
0
        public FrmEdtCaseHis( Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            caseHis = db.Single<CASE_HISTORY>("select * from CASE_HISTORY where ID = @0", _id);
            cASEHISTORYBindingSource.DataSource = caseHis;

            lookUpEdit1.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[]{11});
            lookUpEdit1.Properties.DisplayMember = "DSP_MEMBER";
            lookUpEdit1.Properties.ValueMember = "VALUE_MEMBER";

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 181 });
        }
        public FrmEdtMachineType(Int64 id)
        {
            InitializeComponent();
            _id = id;
            db = new Database("XE");

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_GROUP>("where FATHERID = @0", 15);
            //vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 3);

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(MODELTextEdit, ruleNoEmpty);
            dxValidationProvider1.SetValidationRule(M_TYPELookUpEdit, ruleNoEmpty);

            diag = db.Single<MACHINE_TYPE>(_id);
            mACHINETYPEBindingSource.DataSource = diag;
        }
        public FrmEdtDrugsAllergy(Int64 id)
        {
            InitializeComponent();
            _id = id;

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 185");
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 186");
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 187");
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 183");
            vALUECODEBindingSource4.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 184");

            drugAllergyHis = db.Single<DRUG_ALLERGY_HISTORY>("select * from DRUG_ALLERGY_HISTORY where ID = @0", _id);
            dRUGALLERGYHISTORYBindingSource.DataSource = drugAllergyHis;
        }
        public BSAMemberViewModel ValidateUserNameAndPassword(string username, string password)
        {
            BSAMemberViewModel item1 = null;

            try
            {
                //Connect to the Umbraco DB
                var db = new PetaPoco.Database(sConnectString);

                //Get an IENumberable of MeritBadges objects to iterate over
                var item = db.Single <BSAMember>("Select * from BSAMembers where UserName = @0 and Password = @1 and DeleteRecordFlag = @2", username, password, false);
                item1 = FillViewModelBSAMember(item, false);
            }
            catch (Exception ex)
            {
            }

            return(item1);
        }
        public FrmEdtMachineInfo(Int64 id)
        {
            InitializeComponent();
            db = new Database("XE");
            _id = id;

            vALUEGROUPBindingSource.DataSource = db.Fetch<VALUE_GROUP>("where FATHERID = @0", 15);
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 17);      // 耗材供应商

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(MACHINETYPETextEdit, ruleNoEmpty);                  // 设备类型
            dxValidationProvider1.SetValidationRule(MODELTextEdit, ruleNoEmpty);                        // 设备型号
            dxValidationProvider1.SetValidationRule(SNTextEdit, ruleNoEmpty);                           // 设备序列号
            dxValidationProvider1.SetValidationRule(BED_NOTextEdit, ruleNoEmpty);                       // 所在床位号

            mach = db.Single<MACHINE_INFO>("where ID = @0", _id);
            mACHINEINFOBindingSource.DataSource = mach;
        }
        public FrmEdtDiagonsis_Pathological(Int64 id)
        {
            InitializeComponent();
            db = new Database("XE");
            _id = id;

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(PATHOLOGICAL_DIAGNOSIS_TYPELookUpEdit, ruleNoEmpty);

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 129);
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 123);
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 124);
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 126);
            vALUECODEBindingSource4.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 125);

            diag = db.Single<DIAGNOSIS_PATHOLOGICAL>("where ID = @0", _id);
            dIAGNOSISPATHOLOGICALBindingSource.DataSource = diag;
        }
Ejemplo n.º 22
0
        public FrmEdtUremic(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            uremicHis = db.Single<UREMIC_SYMPTOMS_HI>("select * from UREMIC_SYMPTOMS_HIS where ID = @0", _id);
            uREMICSYMPTOMSHIBindingSource.DataSource = uremicHis;

            DIGESTIVETextEdit.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            DIGESTIVETextEdit.Properties.DataSource = ClsFrmMng.lstIndecumentCode;
            DIGESTIVETextEdit.Properties.DisplayMember = "INDUCEMENT_MEMO";
            DIGESTIVETextEdit.Properties.ValueMember = "INDUCEMENT_MEMO";

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = 192");
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = 189");
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where groupName = 190");
        }
        public FrmEdtBC_Drugs(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            docAdv = db.Single<DOC_ADVICE>("where ID = @0", _id);
            dOCADVICEBindingSource.DataSource = docAdv;

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 18 });

            M_UNITLookUpEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 14 });
            M_UNITLookUpEdit.Properties.DisplayMember = "DSP_MEMBER";
            M_UNITLookUpEdit.Properties.ValueMember = "VALUE_MEMBER";

            M_ACTIONLookUpEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 13 });
            M_ACTIONLookUpEdit.Properties.DisplayMember = "DSP_MEMBER";
            M_ACTIONLookUpEdit.Properties.ValueMember = "VALUE_MEMBER";
        }
        public _FrmDrugSelect(bool isMultipleSelect = false)
        {
            InitializeComponent();
            db = new Database("XE");

            var v = db.Single<VALUE_GROUP>("where ID = @0 order by ID desc", 18);
            lstDrguGrouyp.Add(v);
            GetAllDrugGroup(18);
            vALUEGROUPBindingSource.DataSource = lstDrguGrouyp;

            treeList1.ExpandAll();
            _isMultipleSelect = isMultipleSelect;

            if (!isMultipleSelect)
            {
                repositoryItemCheckEdit1.CheckStyle = DevExpress.XtraEditors.Controls.CheckStyles.Radio;
                gridColumn1.Visible = false;
                xtraTabControl2.Visible = false;
                this.Width = 592;
            }
        }
        public FrmEdtDiagonsis_Complication(Int64 id)
        {
            InitializeComponent();
            db = new Database("XE");
            _id = id;

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(COMPLICATIONS_TYPETextEdit, ruleNoEmpty);

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 131);
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 132);
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 133);
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 134);
            vALUECODEBindingSource4.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 135);
            vALUECODEBindingSource5.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 136);
            vALUECODEBindingSource6.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 221);

            diag = db.Single<DIAGNOSIS_COMPLICATION>("where ID = @0", _id);
            dIAGNOSISCOMPLICATIONBindingSource.DataSource = diag;
        }
        public FrmEdtDiagosis_Primary(Int64 id)
        {
            InitializeComponent();

            db = new Database("XE");
            _id = id;

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(PRIMARY_DISEAE_TYPETextEdit, ruleNoEmpty);

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GroupName = @0", 122);
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where GroupName = @0", 123);
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where GroupName = @0", 124);
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where GroupName = @0", 125);
            vALUECODEBindingSource4.DataSource = db.Fetch<VALUE_CODE>("where GroupName = @0", 126);
            vALUECODEBindingSource5.DataSource = db.Fetch<VALUE_CODE>("where GroupName = @0", 127);
            vALUECODEBindingSource6.DataSource = db.Fetch<VALUE_CODE>("where GroupName = @0", 128);

            diag = db.Single<DIAGNOSIS_PRIMARY_DISEASE>("where ID = @0", _id);
            dIAGNOSISPRIMARYDISEASEBindingSource.DataSource = diag;
        }
        public FrmEdtBloodCleanup_Summary(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            cleanup = db.Single<BLOODCLEANUP>("where ID = @0", _id);
            bLOODCLEANUPBindingSource.DataSource = cleanup;

            CLEANUP_TYPETextEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("select DSP_MEMBER, VALUE_MEMBER from VALUE_CODE where GROUPNAME = @0", new object[] { 1 });
            CLEANUP_TYPETextEdit.Properties.DisplayMember = "DSP_MEMBER";
            CLEANUP_TYPETextEdit.Properties.ValueMember = "VALUE_MEMBER";

            SYMPTOMTextEdit.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            SYMPTOMTextEdit.Properties.DataSource = ClsFrmMng.lstHaveOrNull;
            SYMPTOMTextEdit.Properties.DisplayMember = "MEMO";
            SYMPTOMTextEdit.Properties.ValueMember = "ID";

            BLOOD_PASSTextEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("select DSP_MEMBER, VALUE_MEMBER from VALUE_CODE where GROUPNAME = @0", new object[] { 2 });
            BLOOD_PASSTextEdit.Properties.DisplayMember = "DSP_MEMBER";
            BLOOD_PASSTextEdit.Properties.ValueMember = "VALUE_MEMBER";
        }
        public FrmEdtDiagosis_Allergy(Int64 id)
        {
            InitializeComponent();

            db = new Database("XE");
            _id = id;

            //ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            //ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            //ruleNoEmpty.ErrorText = "该项不能为空。";
            //dxValidationProvider1.SetValidationRule(PRIMARY_DISEAE_TYPETextEdit, ruleNoEmpty);

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 147);
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 148);
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 44);
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 149);
            vALUECODEBindingSource4.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 150);
            vALUEGROUPBindingSource.DataSource = db.Fetch<VALUE_GROUP>("where FATHERID = @0", 18);
            vALUECODEBindingSource6.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 152);
            vALUECODEBindingSource7.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 153);

            diag = db.Single<DIAGNOSIS_ALLERGY>("where ID = @0", _id);
            dIAGNOSISALLERGYBindingSource.DataSource = diag;
        }
        public FrmEdtDiagosis_Outcome(Int64 id)
        {
            InitializeComponent();

            db = new Database("XE");
            _id = id;

            //ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            //ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            //ruleNoEmpty.ErrorText = "该项不能为空。";
            //dxValidationProvider1.SetValidationRule(PRIMARY_DISEAE_TYPETextEdit, ruleNoEmpty);

            // 死亡原因
            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 242);
            // 心血管事件
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 243);
            // 脑管理事件
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 244);
            // 感染
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", 245);

            diag = db.Single<DIAGNOSIS_OUTCOME>("where ID = @0", _id);
            dIAGNOSISOUTCOMEBindingSource.DataSource = diag;
        }
        public FrmEdtPatientBaseInfo(Int64 id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _ID = id;

            //db.OpenSharedConnection();
            patientBase = db.Single<PATIENT_BASEINFO>("select * from PATIENT_BASEINFO where ID = @0", _ID);
            //db.CloseSharedConnection();

            pATIENTBASEINFOBindingSource.DataSource = patientBase;

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(NAMETextEdit, ruleNoEmpty);

            MEDICARE_TYPETextEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("select DSP_MEMBER, VALUE_MEMBER from VALUE_CODE where GROUPNAME = @0", new object[] { 10 });
            MEDICARE_TYPETextEdit.Properties.DisplayMember = "DSP_MEMBER";
            MEDICARE_TYPETextEdit.Properties.ValueMember = "VALUE_MEMBER";

            EDUCATIONAL_LEVELTextEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 8 });
            EDUCATIONAL_LEVELTextEdit.Properties.DisplayMember = "DSP_MEMBER";
            EDUCATIONAL_LEVELTextEdit.Properties.ValueMember = "VALUE_MEMBER";

            MARITAL_STATUSTextEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 9 });
            MARITAL_STATUSTextEdit.Properties.DisplayMember = "DSP_MEMBER";
            MARITAL_STATUSTextEdit.Properties.ValueMember = "VALUE_MEMBER";

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupname = 42");
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupname = 41");
            vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where groupname = 62");
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where groupname = 63");
        }
        protected override void SelectSingleEntity(int entityCount)
        {
            using (var database = new Database("SQLiteTest"))
            {
                using (var transaction = database.GetTransaction())
                {
                    do
                    {
                        database.Single<Entity>(entityCount);
                        entityCount--;
                    }
                    while (entityCount > 0);

                    transaction.Complete();
                }
            }
        }
Ejemplo n.º 32
0
        void IClass.DeleteClass(CheckIn.Model.Class classInfo)
        {
            var entity = _db.Single <Entity.ClassEntity>(classInfo.Id);

            _db.Delete(entity);
        }
Ejemplo n.º 33
0
 public bool EmailExists(string email)
 {
     var db = new Database(_config.ConnectionString, "System.Data.SqlClient");
     return db.Single<bool>("select count(*) from MR.tUser where Email = @0", email);
 }