Exemplo n.º 1
0
        public static List <Model.TestInfoModel> AthTestUtil(DataSet ds)
        {
            List <Model.TestInfoModel> testInfoModelList = new List <Model.TestInfoModel>();

            BLL.TB_TestInfo    testInfoBLL    = new BLL.TB_TestInfo();
            BLL.TB_AthleteInfo athleteInfoBLL = new BLL.TB_AthleteInfo();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DataRow             dr            = ds.Tables[0].Rows[i];
                Model.TestInfoModel testInfoModel = new Model.TestInfoModel();
                testInfoModel.Index = i + 1;

                testInfoBLL.GetModelFromDataRow(dr, testInfoModel);
                athleteInfoBLL.GetAthleteInfoFromDataRow(dr, testInfoModel);

                testInfoModel.DGravitycomp = DictCache.GetDictValue(DictCache.Gravitycomp, testInfoModel.Gravitycomp);
                testInfoModel.DInsuredSide = DictCache.GetDictValue(DictCache.InsuredSide, testInfoModel.InsuredSide);
                testInfoModel.DJoint       = DictCache.GetDictValue(DictCache.Joint, testInfoModel.Joint);
                testInfoModel.DJointSide   = DictCache.GetDictValue(DictCache.JointSide, testInfoModel.Joint_Side);
                testInfoModel.DTestMode    = DictCache.GetDictValue(DictCache.TestMode, testInfoModel.Test_Mode);

                testInfoModel.DPlane = DictCache.GetDict(testInfoModel.Joint, testInfoModel.Plane, testInfoModel.Test_Mode).Dict_Value;

                testInfoModelList.Add(testInfoModel);
            }
            return(testInfoModelList);
        }
Exemplo n.º 2
0
        //刷新数据表
        private void RefrenshDataGridSource()
        {
            testInfoModelList = new List <Model.TestInfoModel>();
            existsIDs        += "0";
            string sql = "select ath.*,test.*,"
                         + "(select dict_value from tb_dict where dict_groupid=3 and dict_key=test.joint_side) as djointside,"
                         + "(select dict_value from tb_dict where dict_groupid=1 and dict_key=test.test_mode) as dtestmode,"
                         + "(select dict_value from tb_dict where dict_groupid=2 and dict_key=test.joint) as djoint,"
                         + "(select dict_value from tb_dict where dict_groupid=(select id from tb_dict where dict_groupid=2 and dict_key=test.joint) and dict_key=test.plane and instr(dict_groupid2,test.test_mode)>0) as dplane,"
                         + "(select dict_value from tb_dict where dict_groupid=4 and dict_key=test.InsuredSide) as dInsuredSide,"
                         + "(select dict_value from tb_dict where dict_groupid=5 and dict_key=test.Gravitycomp) as dGravitycomp "
                         + "from tb_athleteinfo as ath inner join tb_testinfo as test on ath.id=test.ath_id where 0=0 ";

            sql += " and test.id in (" + existsIDs + ")";

            DataSet ds = DbHelperOleDb.Query(sql);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DataRow             dr            = ds.Tables[0].Rows[i];
                Model.TestInfoModel testInfoModel = new Model.TestInfoModel();
                testInfoModel.Index        = i + 1;
                testInfoModel.DGravitycomp = dr["dGravitycomp"].ToString();
                testInfoModel.DInsuredSide = dr["dInsuredSide"].ToString();
                testInfoModel.DJoint       = dr["djoint"].ToString();
                testInfoModel.DJointSide   = dr["djointside"].ToString();
                testInfoModel.DPlane       = dr["dplane"].ToString();
                testInfoModel.DTestMode    = dr["dtestmode"].ToString();
                testInfoBLL.GetModelFromDataRow(dr, testInfoModel);
                athleteInfoBLL.GetAthleteInfoFromDataRow(dr, testInfoModel);
                testInfoModelList.Add(testInfoModel);
            }
            dgTestInfo.ItemsSource  = testInfoModelList;
            lbFileNames.ItemsSource = existsFiles;
        }
Exemplo n.º 3
0
        public static List<Model.TestInfoModel> AthTestUtil(DataSet ds)
        {
            List<Model.TestInfoModel> testInfoModelList = new List<Model.TestInfoModel>();
             BLL.TB_TestInfo testInfoBLL = new BLL.TB_TestInfo();
             BLL.TB_AthleteInfo athleteInfoBLL = new BLL.TB_AthleteInfo();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DataRow dr = ds.Tables[0].Rows[i];
                Model.TestInfoModel testInfoModel = new Model.TestInfoModel();
                testInfoModel.Index = i + 1;

                testInfoBLL.GetModelFromDataRow(dr, testInfoModel);
                athleteInfoBLL.GetAthleteInfoFromDataRow(dr, testInfoModel);

                testInfoModel.DGravitycomp = DictCache.GetDictValue(DictCache.Gravitycomp, testInfoModel.Gravitycomp);
                testInfoModel.DInsuredSide = DictCache.GetDictValue(DictCache.InsuredSide, testInfoModel.InsuredSide);
                testInfoModel.DJoint = DictCache.GetDictValue(DictCache.Joint, testInfoModel.Joint);
                testInfoModel.DJointSide = DictCache.GetDictValue(DictCache.JointSide, testInfoModel.Joint_Side);
                testInfoModel.DTestMode = DictCache.GetDictValue(DictCache.TestMode, testInfoModel.Test_Mode);

                testInfoModel.DPlane = DictCache.GetDict(testInfoModel.Joint, testInfoModel.Plane, testInfoModel.Test_Mode).Dict_Value;

                testInfoModelList.Add(testInfoModel);
            }
            return testInfoModelList;
        }