/// <summary> /// 导入高考成绩,从17表的报名库中或12表的投档单中 /// </summary> /// <param name="dt"></param> /// <param name="dr"></param> /// <param name="lbmkID"></param> protected void InportGkcj(DataTable dt, List <BMKTable> BMK_list, List <ListCompareTable> CJXDM_list) { List <T_ksxkcj> listAll = new List <T_ksxkcj>(); foreach (DataRow dr in dt.Rows) { long lbmkID = GetBMKIDFromList(BMK_list, dr["KSH"].ToString()); if (lbmkID > 0) { for (int i = 0; i < dr.ItemArray.Length; i++) { string ColumnName = dt.Columns[i].ColumnName; if (ColumnName.Contains("GKCJX")) { T_ksxkcj model = new T_ksxkcj(); if (dr.ItemArray[i] != DBNull.Value) { try { model.Ddcj = Convert.ToDouble(dr.ItemArray[i]); } catch { } } if (model.Ddcj > 0) { string cjxdm = ColumnName.Replace("GKCJX", ""); model.RelationID = lbmkID; model.Kmdm = 0; model.KmdmOrigin = 0; ListCompareTable oneCompare = GetCompareList(CJXDM_list, cjxdm); if (oneCompare != null) { model.CjxdmOrigin = oneCompare.lOriginID; model.Cjxdm = oneCompare.lNewID; } model.Djff = 0; model.Cjlx = 2; listAll.Add(model); } } } } } AddRecords(listAll); }
/// <summary> /// 增加记录 /// </summary> /// <param name="dr"></param> /// <returns></returns> public void AddNewCj(DataTable dt, bool IsOldData) { List <T_ksxkcj> listAdd = new List <T_ksxkcj>(); foreach (DataRow dr in dt.Rows) { double dDdcj = Convert.ToDouble(GetOneStrValue(dr, "DDCJ", CosDataBase.FLOAT_TYPE)); if (dDdcj > 0) { bmkTableManage bmkMan = new bmkTableManage(); //long lbmkID = bmkMan.GetbmkID(dr["KSH"].ToString()); long lbmkID = GetBMKIDFromList(BMK_list, dr["KSH"].ToString()); if (lbmkID != 0) { long kmdmOrigin = GetOriginListID(KMDM_list, GetOneStrValue(dr, "KMDM", CosDataBase.LONGINT_TYPE)); long cjxdmOrigin = GetOriginListID(CJXDM_list, GetOneStrValue(dr, "CJXDM", CosDataBase.LONGINT_TYPE)); short cjlx = 1; if (!IsOldData) { cjlx = Convert.ToInt16(GetOneStrValue(dr, "CJLX", CosDataBase.SMALLINT_TYPE)); } //Expression<Func<T_ksxkcj, bool>> where = (c => c.RelationID == lbmkID && c.KmdmOrigin == kmdmOrigin && c.CjxdmOrigin == cjxdmOrigin && c.Cjlx == cjlx); //List<T_ksxkcj> list = GetRecord(where); //if ((list == null) || (list.Count == 0)) //{ T_ksxkcj ksxkcj_model = new T_ksxkcj(); ksxkcj_model.RelationID = lbmkID; ksxkcj_model.Xkbmh = GetOneStrValue(dr, "XKBMH"); ksxkcj_model.Kmdm = GetMainListID(KMDM_list, GetOneStrValue(dr, "KMDM", CosDataBase.LONGINT_TYPE)); ksxkcj_model.KmdmOrigin = kmdmOrigin; ksxkcj_model.Cjxdm = GetMainListID(CJXDM_list, GetOneStrValue(dr, "CJXDM", CosDataBase.LONGINT_TYPE)); ksxkcj_model.CjxdmOrigin = cjxdmOrigin; ksxkcj_model.Cjlx = cjlx; ksxkcj_model.Ksny = Convert.ToDateTime(GetOneStrValue(dr, "KSNY", CosDataBase.DATETIME_TYPE)); ksxkcj_model.Ddcj = dDdcj; ksxkcj_model.Djff = Convert.ToDouble(GetOneStrValue(dr, "DJFF", CosDataBase.FLOAT_TYPE)); listAdd.Add(ksxkcj_model); //} } } } AddRecords(listAdd); }