private T_tddw getOneMainRecord(long lGxID, T_tddw_Origin orgModel) { Expression <Func <T_tddw, bool> > where = (c => c.KldmOrigin == orgModel.Kldm && c.PcdmOrigin == orgModel.Pcdm && c.JhxzdmOrigin == orgModel.Jhxzdm && c.JhlbdmOrigin == orgModel.Jhlbdm && c.GxID == lGxID && c.Code == orgModel.DM); List <T_tddw> list = GetRecord(where); if ((list != null) && (list.Count > 0)) { return(list[0]); } else { return(null); } }
/// <summary> /// 从高校代码表中找到可能的高校代码 /// </summary> /// <param name="sName"></param> /// <returns></returns> //private long GetGxID(string sName = null) //{ // if (sName != null) // { // ArrayList names = new ArrayList(); // ArrayList values = new ArrayList(); // ArrayList signs = new ArrayList(); // names.Add("DelFlag"); values.Add(false); signs.Add(SIGN.Equal); // //names.Add("Name"); values.Add(sName); signs.Add(SIGN.AntiLike); // Expression<Func<Td_gxdm, bool>> where = GetAndLambdaExpression<Td_gxdm>(names, values, signs); // List<Td_gxdm> list = GetRecord(where); // if ((list != null) && (list.Count > 0)) // { // foreach (Td_gxdm model in list) // { // if (sName.Contains(model.Name)) // return model.ID; // } // } // return 0; // } // else // { // string[] key = { CookieKeys.USERGXID }; // return Convert.ToInt64((new UserInfoManage()).GetLoginUserInfo(key)[0]); // } //} private List <T_tddw_Origin> InportSomeTddwOriginTable(DataTable dt, int nYear, long lProvinceID) { List <T_tddw_Origin> returnArr = new List <T_tddw_Origin>(); List <T_tddw_Origin> addArr = new List <T_tddw_Origin>(); foreach (DataRow dr in dt.Rows) { string dm = "", mc = ""; dm = dr["TDDWDM"].ToString(); mc = dr["TDDWMC"].ToString(); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); names.Add("DelFlag"); values.Add(false); names.Add("YearCode"); values.Add(nYear); names.Add("ProvinceID"); values.Add(lProvinceID); names.Add("DM"); values.Add(dm); names.Add("MC"); values.Add(mc); Expression <Func <T_tddw_Origin, bool> > where = GetAndLambdaExpression <T_tddw_Origin>(names, values); List <T_tddw_Origin> list = GetRecord(where); if ((list != null) && (list.Count > 0)) { returnArr.Add(list[0]); } else { T_tddw_Origin model = new T_tddw_Origin(); model.YearCode = nYear; model.ProvinceID = lProvinceID; model.DM = dm; model.MC = mc; model.RelationID = 0; model.Kldm = GetOriginListID(KLDM_list, GetOneStrValue(dr, "KLDM", CosDataBase.LONGINT_TYPE)); model.Pcdm = GetOriginListID(PCDM_list, GetOneStrValue(dr, "PCDM", CosDataBase.LONGINT_TYPE)); model.Jhxzdm = GetOriginListID(JHXZDM_list, GetOneStrValue(dr, "JHXZDM", CosDataBase.LONGINT_TYPE)); model.Jhlbdm = GetOriginListID(JHLBDM_list, GetOneStrValue(dr, "JHLBDM", CosDataBase.LONGINT_TYPE)); model.Csmbh = GetOneStrValue(dr, "CSMBH"); model.Tag = GetOneStrValue(dr, "TAG"); addArr.Add(model); returnArr.Add(model); } } if ((addArr != null) && (addArr.Count > 0)) { AddRecords(addArr); } return(returnArr); }