public static Object getCarMake(int i, int CM_Code) { BL_MyCar Car = new BL_MyCar(); CT_Make CarMake = Car.getCarMake(i, CM_Code); if (CarMake != null && !Intern) { CarMake.MK_Make_EN = CarMake.MK_Make_CN; } return(CarMake); }
/// <summary> /// Param_List 特定Sql i=1 type=11;i=2 type=12,MK_Code 代表CS_Code; /// i=0;根据MK_Code得到Make; /// i=1;根据CM_Code反推得到Make; /// i=2;根据SC_Code反推得到Make; /// </summary> /// <param name="i"></param> /// <param name="CM_Code"></param> /// <returns></returns> public CT_Make GetMake(int i, int MK_Code) { string strSql = string.Empty; if (i == 0) { strSql = string.Format(@"select MK_Code,MK_Make_EN,MK_Make_CN from CT_Make where MK_Code={0};", MK_Code); } else if (i == 1) { strSql = string.Format(@"select MK_Code,MK_Make_EN,MK_Make_CN from CT_Make inner join CT_Car_Model on MK_Code=CM_MK_Code where CM_Code={0};", MK_Code); } else if (i == 2) { strSql = string.Format(@"select MK_Code,MK_Make_EN,MK_Make_CN from CT_Make inner join CT_Car_Model on MK_Code=CM_MK_Code inner join CT_Car_Style on CM_Code=CS_CM_Code where CS_Code={0};", MK_Code); } CT_Make Make = DataHelper.ConvertToObject <CT_Make>(strSql); return(Make); }