private void execute(object source, ElapsedEventArgs e)
            {
                TMSConverter converter = TMSConverter.GetInstance();

                FillUtil.FillSelect(this.document, "DropDownList5", model.City, converter.Convert("CITY", model.City), true);
                DistrictFiller filler = new DistrictFiller(this.document, this.model);

                filler.Fill();
            }
            private void execute(object source, ElapsedEventArgs e)
            {
                TMSConverter converter = TMSConverter.GetInstance();

                FillUtil.FillSelect(this.document, "DropDownList6", model.District, converter.Convert("DISTRICT", model.District));
                RegisterAddressFiller filler = new RegisterAddressFiller(this.document, this.model);

                filler.Fill();
            }
示例#3
0
        internal static IList Find(ConditionInfo condition)
        {
            IList results = ObjectPool.FindByQuery(condition);

            if (results != null)
            {
                return(results);
            }

            if ("*".Equals(condition.SelectedItem))
            {
                condition.State.includeAll();
            }
            else
            {
                condition.State.include(SqlBuilder.GetIncludeProperty(condition.SelectedItem));
            }

            IList      includeEntityPropertyList = condition.State.Includer.EntityPropertyList;
            IDbCommand cmd = DataFactory.GetCommand(condition.Sql, DbContext.getConnection(condition.State.EntityInfo));

            foreach (String key in condition.Parameters.Keys)
            {
                DataFactory.SetParameter(cmd, key, condition.Parameters[key]);
            }

            Hashtable   hashtable = new Hashtable();
            IDataReader record    = null;

            results = new ArrayList();
            try {
                record = cmd.ExecuteReader();
                while (record.Read())
                {
                    EntityPropertyUtil.Fill_EntityProperty_Ids(record, includeEntityPropertyList, ref hashtable);
                    results.Add(FillUtil.Populate(record, condition.State));
                }
            }
            catch (Exception ex) {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                throw new OrmException(ex.Message, ex);
            }
            finally {
                OrmHelper.CloseDataReader(record);
            }

            if (results.Count == 0)
            {
                return(results);
            }

            return(EntityPropertyUtil.setEntityProperty(condition.State, results, hashtable));
        }
示例#4
0
        public void Fill(object data)
        {
            StudentModel model     = (StudentModel)data;
            PMSConverter converter = PMSConverter.GetInstance();

            FillUtil.FillTextByName(GetDocument(), "XYJBXXB/XM", converter.Convert("NAME", model.Name));
            FillUtil.FillSelect(GetDocument(), "xb", model.Sex, converter.Convert("SEX", model.Sex));
            FillUtil.FillText(GetDocument(), "birthday", converter.Convert("BIRTHDAY", model.Birthday));
            FillUtil.FillSelect(GetDocument(), "zjmc", model.CertificateType, converter.Convert("CERTIFICATE_TYPE", model.CertificateType));
            FillUtil.FillText(GetDocument(), "sfzmhm", converter.Convert("CERTIFICATE_CODE", model.CertificateCode));
            FillUtil.FillText(GetDocument(), "XYJBXXB/ZZZM", converter.Convert("TEMP_LIVE_CODE", model.TempLiveCode));
            FillUtil.FillSelectByName(GetDocument(), "XYJBXXB/XXLX", model.ApplyType, converter.Convert("APPLY_TYPE", model.ApplyType));
            FillUtil.FillSelect(GetDocument(), "xxcx", model.ApplyCarType, converter.Convert("APPLY_CAR_TYPE", model.ApplyCarType));
            FillUtil.FillSelect(GetDocument(), "xzjcxdh", model.AllowedCarType, converter.Convert("ALLOWED_CAR_TYPE", model.AllowedCarType));
            FillUtil.FillSelectByName(GetDocument(), "XYJBXXB/GJ", model.Nationality, converter.Convert("NATIONNALITY", model.Nationality));
            FillUtil.FillSelectByName(GetDocument(), "XYJBXXB/XYLY", model.CensusRegister, converter.Convert("CENSUS_REGISTER", model.CensusRegister));
            FillUtil.FillTextByName(GetDocument(), "XYJBXXB/LXDH2", converter.Convert("TELEPHONE", model.Telephone));
            FillUtil.FillTextByName(GetDocument(), "XYJBXXB/LXDH1", converter.Convert("MOBILEPHONE", model.Mobilephone));
            FillUtil.FillText(GetDocument(), "dzyx", converter.Convert("EMAIL", model.Email));
            FillUtil.FillText(GetDocument(), "yzbm", converter.Convert("POSTALCODE", model.Postalcode));
            FillUtil.FillText(GetDocument(), "sg", converter.Convert("STATURE", model.Stature));
            FillUtil.FillText(GetDocument(), "zsl", converter.Convert("LEFT_EYESIGHT", model.LeftEyesight));
            FillUtil.FillText(GetDocument(), "ysl", converter.Convert("RIGHT_EYESIGHT", model.RightEyesight));
            FillUtil.FillSelect(GetDocument(), "bsl", model.Distinguish, converter.Convert("DISTINGUISH", model.Distinguish));
            FillUtil.FillSelect(GetDocument(), "tl", model.Audition, converter.Convert("AUDITION", model.Audition));
            FillUtil.FillSelect(GetDocument(), "sz", model.UpperLimb, converter.Convert("UPPER_LIMB", model.UpperLimb));
            FillUtil.FillSelect(GetDocument(), "zxz", model.LeftLowerLimb, converter.Convert("LEFT_LOWER_LIMB", model.LeftLowerLimb));
            FillUtil.FillSelect(GetDocument(), "yxz", model.RightLowerLimb, converter.Convert("RIGHT_LOWER_LIMB", model.RightLowerLimb));
            FillUtil.FillSelect(GetDocument(), "qgjb", model.Neck, converter.Convert("NECK", model.Neck));
            FillUtil.FillText(GetDocument(), "tjrq", converter.Convert("CHECK_TIME", model.CheckTime));
            FillUtil.FillSelect(GetDocument(), "tjyy", model.CheckHospital, converter.Convert("CHECK_HOSPITAL", model.CheckHospital));
            FillUtil.FillTextByName(GetDocument(), "XYJBXXB/BMRQ", converter.Convert("ENROLL_TIME", model.EnrollTime));
            FillUtil.FillSelect(GetDocument(), "ssxq", model.Area, converter.Convert("AREA", model.Area));
            FillUtil.FillSelect(GetDocument(), "aaa", model.Area, converter.Convert("CONTACT_AREA", model.Area));
            FillUtil.FillSelectByName(GetDocument(), "XYJBXXB/BMTJ", model.EnrollType, converter.Convert("ENROLL_TYPE", model.EnrollType));
            FillUtil.FillSelect(GetDocument(), "DJZSXZQH", model.Province, converter.Convert("PROVINCE", model.Province), true);
            FillUtil.FillSelect(GetDocument(), "DJZSXZQH2", model.City, converter.Convert("CITY", model.City), true);
            FillUtil.FillSelect(GetDocument(), "DJZSXZQH3", model.District, converter.Convert("DISTRICT", model.District));
            FillUtil.FillText(GetDocument(), "djzsdz", converter.Convert("REGISTER_ADDRESS", model.RegisterAddress));
            FillUtil.FillText(GetDocument(), "lxdz", converter.Convert("CONTACT_ADDRESS", model.ContactAddress));
            FillUtil.FillTextByName(GetDocument(), "XYJBXXB/TJR", converter.Convert("REFEREE", model.Referee));
        }
示例#5
0
        private static IEntity findById_Private(int id, ObjectInfo state)
        {
            if (id < 0)
            {
                return(null);
            }

            IEntity result = null;

            SqlBuilder sh = new SqlBuilder(state.EntityInfo);

            processIncluder(state.Includer);
            String      sql  = sh.GetFindById(id, state.Includer.SelectedProperty);
            IDbCommand  cmd  = DataFactory.GetCommand(sql, DbContext.getConnection(state.EntityInfo));
            IList       list = new ArrayList();
            IDataReader rd   = null;

            try {
                rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    list.Add(FillUtil.Populate(rd, state));
                }
            }
            catch (Exception ex) {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                throw ex;
            }
            finally {
                OrmHelper.CloseDataReader(rd);
            }

            if (list.Count > 0)
            {
                result = list[0] as IEntity;
            }

            result = setEntityProperty(result, id, state);

            return(result);
        }
        public void Fill(object data)
        {
            StudentModel model     = (StudentModel)data;
            TMSConverter converter = TMSConverter.GetInstance();

            FillUtil.FillText(GetDocument(), "txtXueyh", converter.Convert("CODE", model.Code));
            FillUtil.FillText(GetDocument(), "txtXingming", converter.Convert("NAME", model.Name));
            FillUtil.FillSelect(GetDocument(), "drpXingbie", model.Sex, converter.Convert("SEX", model.Sex));
            FillUtil.FillText(GetDocument(), "txtChusrq", converter.Convert("BIRTHDAY", model.Birthday));
            FillUtil.FillSelect(GetDocument(), "drpZhengjzl", model.CertificateType, converter.Convert("CERTIFICATE_TYPE", model.CertificateType));
            FillUtil.FillText(GetDocument(), "txtShenfhm", converter.Convert("CERTIFICATE_CODE", model.CertificateCode));
            FillUtil.FillText(GetDocument(), "txtZanzzhm", converter.Convert("TEMP_LIVE_CODE", model.TempLiveCode));
            FillUtil.FillSelect(GetDocument(), "drpShenqzl", model.ApplyType, converter.Convert("APPLY_TYPE", model.ApplyType));
            FillUtil.FillSelect(GetDocument(), "drpShenqcx", model.ApplyCarType, converter.Convert("APPLY_CAR_TYPE", model.ApplyCarType));
            FillUtil.FillSelect(GetDocument(), "ddl_ycx", model.AllowedCarType, converter.Convert("ALLOWED_CAR_TYPE", model.AllowedCarType));
            FillUtil.FillSelect(GetDocument(), "drpguoj", model.Nationality, converter.Convert("NATIONNALITY", model.Nationality));
            FillUtil.FillSelect(GetDocument(), "drphuji", model.CensusRegister, converter.Convert("CENSUS_REGISTER", model.CensusRegister));
            FillUtil.FillText(GetDocument(), "txtGuddh", converter.Convert("TELEPHONE", model.Telephone));
            FillUtil.FillText(GetDocument(), "txtDianh", converter.Convert("MOBILEPHONE", model.Mobilephone));
            FillUtil.FillText(GetDocument(), "Textbox1", converter.Convert("EMAIL", model.Email));
            FillUtil.FillText(GetDocument(), "txtYouzbm", converter.Convert("POSTALCODE", model.Postalcode));
            FillUtil.FillText(GetDocument(), "txtshengao", converter.Convert("STATURE", model.Stature));
            FillUtil.FillText(GetDocument(), "txtzuoshil", converter.Convert("LEFT_EYESIGHT", model.LeftEyesight));
            FillUtil.FillText(GetDocument(), "txtyoushil", converter.Convert("RIGHT_EYESIGHT", model.RightEyesight));
            FillUtil.FillSelect(GetDocument(), "drpbiansl", model.Distinguish, converter.Convert("DISTINGUISH", model.Distinguish));
            FillUtil.FillSelect(GetDocument(), "drptingl", model.Audition, converter.Convert("AUDITION", model.Audition));
            FillUtil.FillSelect(GetDocument(), "drpshangz", model.UpperLimb, converter.Convert("UPPER_LIMB", model.UpperLimb));
            FillUtil.FillSelect(GetDocument(), "drpzuoxz", model.LeftLowerLimb, converter.Convert("LEFT_LOWER_LIMB", model.LeftLowerLimb));
            FillUtil.FillSelect(GetDocument(), "drpyouxz", model.RightLowerLimb, converter.Convert("RIGHT_LOWER_LIMB", model.RightLowerLimb));
            FillUtil.FillSelect(GetDocument(), "drpqugjb", model.Neck, converter.Convert("NECK", model.Neck));
            FillUtil.FillText(GetDocument(), "txtriqi1", converter.Convert("CHECK_TIME", model.CheckTime));
            FillUtil.FillSelect(GetDocument(), "drpyiyuan", model.CheckHospital, converter.Convert("CHECK_HOSPITAL", model.CheckHospital));
            FillUtil.FillText(GetDocument(), "txtRiqi", converter.Convert("ENROLL_TIME", model.EnrollTime));
            FillUtil.FillSelect(GetDocument(), "drpbaomd", model.EnrollSite, converter.Convert("ENROLL_SITE", model.EnrollSite));
            FillUtil.FillSelect(GetDocument(), "drpDiqu", model.Area, converter.Convert("AREA", model.Area));
            FillUtil.FillSelect(GetDocument(), "DropDownList4", model.Province, converter.Convert("PROVINCE", model.Province), true);
            CityFiller filler = new CityFiller(GetDocument(), model);

            filler.Fill();
            FillUtil.FillText(GetDocument(), "txtLianxdz", converter.Convert("CONTACT_ADDRESS", model.ContactAddress));
            FillUtil.FillText(GetDocument(), "txtjiesr", converter.Convert("REFEREE", model.Referee));
        }
        public void Fill(object data)
        {
            StudentModel model     = (StudentModel)data;
            DMSConverter converter = DMSConverter.GetInstance();
            string       city      = model.City;

            string value = "320826";

            if ("苏州市".Equals(city))
            {
                value = converter.Convert("DISTRICT", model.District);
            }

            FillUtil.FillSelect(GetDocument(), "djzsxzqh", model.District, value);
            FillUtil.FillText(GetDocument(), "djzsxxdz", converter.Convert("REGISTER_ADDRESS", model.RegisterAddress));
            FillUtil.FillSelect(GetDocument(), "lxzsxzqh", model.Area, converter.Convert("CONTACT_AREA", model.Area));
            FillUtil.FillText(GetDocument(), "lxzsxxdz", converter.Convert("CONTACT_ADDRESS", model.ContactAddress));
            FillUtil.FillText(GetDocument(), "lxdh", converter.Convert("TELEPHONE", model.Telephone));
            FillUtil.FillText(GetDocument(), "sjhm", converter.Convert("MOBILEPHONE", model.Mobilephone));
            FillUtil.FillText(GetDocument(), "tjr", converter.Convert("REFEREE", model.Referee));
        }
示例#8
0
        private static IEntity findById_Private(int id, ObjectInfo state)
        {
            if (id < 0)
            {
                return(null);
            }

            IEntity result = null;

            SqlBuilder sh = new SqlBuilder(state.EntityInfo);

            processIncluder(state.Includer);
            String sql  = sh.GetFindById(id, state.Includer.SelectedProperty);
            var    conn = DbContext.getConnection(state.EntityInfo);

            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();
                OrmHelper.initCount++;
                LogManager.GetLogger("Class:System.ORM.Operation.FindByIdOperation Method:findById_Private").Info("数据库连接已开启【" + OrmHelper.initCount + "】");
            }
            IDbCommand  cmd  = DataFactory.GetCommand(sql, conn);
            IList       list = new ArrayList();
            IDataReader rd   = null;

            try {
                rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    list.Add(FillUtil.Populate(rd, state));
                }
            }
            catch (Exception ex) {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                throw ex;
            }
            finally
            {
                if (!DbContext.shouldTransaction())
                {
                    if (conn.State != ConnectionState.Closed)
                    {
                        conn.Close();
                        conn.Dispose();
                        OrmHelper.clostCount++;
                        LogManager.GetLogger("Class:System.ORM.Operation.FindByIdOperation Method:findById_Private").Info("数据库连接已关闭【" + OrmHelper.clostCount + "】");
                    }
                }
                OrmHelper.CloseDataReader(rd);
            }

            if (list.Count > 0)
            {
                result = list[0] as IEntity;
            }

            result = setEntityProperty(result, id, state);

            return(result);
        }
            private void execute(object source, ElapsedEventArgs e)
            {
                TMSConverter converter = TMSConverter.GetInstance();

                FillUtil.FillText(this.document, "txtZhusdz", converter.Convert("REGISTER_ADDRESS", model.RegisterAddress));
            }
示例#10
0
        internal static IList Find(ConditionInfo condition)
        {
            IList results = ObjectPool.FindByQuery(condition);

            if (results != null)
            {
                return(results);
            }

            if ("*".Equals(condition.SelectedItem))
            {
                condition.State.includeAll();
            }
            else
            {
                condition.State.include(SqlBuilder.GetIncludeProperty(condition.SelectedItem));
            }

            IList      includeEntityPropertyList = condition.State.Includer.EntityPropertyList;
            IDbCommand cmd = DataFactory.GetCommand(condition.Sql, DbContext.getConnection(condition.State.EntityInfo));

            foreach (String key in condition.Parameters.Keys)
            {
                DataFactory.SetParameter(cmd, key, condition.Parameters[key]);
            }

            Hashtable   hashtable = new Hashtable();
            IDataReader record    = null;

            results = new ArrayList();
            try
            {
                record = cmd.ExecuteReader();
                while (record.Read())
                {
                    EntityPropertyUtil.Fill_EntityProperty_Ids(record, includeEntityPropertyList, ref hashtable);
                    results.Add(FillUtil.Populate(record, condition.State));
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                throw ex;
            }
            finally
            {
                if (!DbContext.shouldTransaction())
                {
                    if (cmd.Connection.State != ConnectionState.Closed)
                    {
                        cmd.Connection.Close();
                        cmd.Connection.Dispose();
                        OrmHelper.clostCount++;
                        LogManager.GetLogger("Class:System.ORM.Operation.FindByOperation Method:Find").Info("数据库连接已关闭【" + OrmHelper.clostCount + "】");
                    }
                }
                OrmHelper.CloseDataReader(record);
            }

            if (results.Count == 0)
            {
                return(results);
            }

            return(EntityPropertyUtil.setEntityProperty(condition.State, results, hashtable));
        }