public List <ExpressInfo> getExpressInfos(string sql) { string sqlStr = "select EI_ID,EI_ORDERNO,EL_LCMAINID,EI_LCID,EI_LCNAME,EI_SENDERID,EI_STORETIME,EI_STOREUSERPHONE,EL_TAKEUSERTYPE,EI_TAKETIME" + ",EI_TAKEIDTYPE,EI_TAKEIDCODE,EI_PAYMENTMODE,EI_PAYMENTMONEY,EI_BARCODE,EI_EXPTYPE,EI_MAILTYPE,EI_EBOXID,EI_EBOXNO,EI_EBOXABBR,EI_LATTICENO,EI_VALIDATECODE" + ",EL_EXPSAVEMODE,EL_EXPREMARK,EL_OVERTIME,TF_BUZSTATUS" + ",EI_SENDERNAME,EI_SENDERPHONE,EI_TAKEUSERNAME,EI_TAKEUSERPHONE from EBOX_EXPRESINFO " + sql; LogHelper.Log("getExpressInfos SQL = " + sqlStr); SQLiteCommand cmd = new SQLiteCommand(); cmd.CommandText = sqlStr; cmd.Connection = conn; SQLiteDataReader reader = cmd.ExecuteReader(); List <ExpressInfo> lists = new List <ExpressInfo>(); while (reader.Read()) { ExpressInfo result = convertExpressInfo(reader); lists.Add(result); } cmd.Dispose(); return(lists); }
public ExpressInfo convertExpressInfo(SQLiteDataReader reader) { ExpressInfo expressInfo = new ExpressInfo(); expressInfo.EIID = reader.GetInt32(0); if (!Convert.IsDBNull(reader.GetValue(1))) { expressInfo.EIORDERNO = reader.GetString(1); } if (!Convert.IsDBNull(reader.GetValue(2))) { expressInfo.ELLCMAINID = reader.GetInt32(2); } if (!Convert.IsDBNull(reader.GetValue(3))) { expressInfo.EILCID = reader.GetInt32(3); } if (!Convert.IsDBNull(reader.GetValue(4))) { expressInfo.EILCNAME = reader.GetString(4); } if (!Convert.IsDBNull(reader.GetValue(5))) { expressInfo.EISENDERID = reader.GetInt32(5); } if (!Convert.IsDBNull(reader.GetValue(6))) { expressInfo.EISTORETIME = reader.GetString(6); } if (!Convert.IsDBNull(reader.GetValue(7))) { expressInfo.EISTOREUSERPHONE = reader.GetString(7); } if (!Convert.IsDBNull(reader.GetValue(8))) { expressInfo.ELTAKEUSERTYPE = reader.GetInt32(8); } if (!Convert.IsDBNull(reader.GetValue(9))) { expressInfo.EITAKETIME = reader.GetString(9); } if (!Convert.IsDBNull(reader.GetValue(10))) { expressInfo.EITAKEIDTYPE = reader.GetInt32(10); } if (!Convert.IsDBNull(reader.GetValue(11))) { expressInfo.EITAKEIDCODE = reader.GetString(11); } if (!Convert.IsDBNull(reader.GetValue(12))) { expressInfo.EIPAYMENTMODE = reader.GetInt32(12); } if (!Convert.IsDBNull(reader.GetValue(13))) { expressInfo.EIPAYMENTMONEY = reader.GetDouble(13); } if (!Convert.IsDBNull(reader.GetValue(14))) { expressInfo.EIBARCODE = reader.GetString(14); } if (!Convert.IsDBNull(reader.GetValue(15))) { expressInfo.EIEXPTYPE = reader.GetInt32(15); } if (!Convert.IsDBNull(reader.GetValue(16))) { expressInfo.EIMAILTYPE = reader.GetInt32(16); } if (!Convert.IsDBNull(reader.GetValue(17))) { expressInfo.EIEBOXID = reader.GetInt32(17); } if (!Convert.IsDBNull(reader.GetValue(18))) { expressInfo.EIEBOXNO = reader.GetString(18); } if (!Convert.IsDBNull(reader.GetValue(19))) { expressInfo.EIEBOXABBR = reader.GetString(19); } if (!Convert.IsDBNull(reader.GetValue(20))) { expressInfo.EILATTICENO = reader.GetString(20); } if (!Convert.IsDBNull(reader.GetValue(21))) { expressInfo.EIVALIDATECODE = reader.GetInt64(21); } if (!Convert.IsDBNull(reader.GetValue(22))) { expressInfo.ELEXPSAVEMODE = reader.GetInt32(22); } if (!Convert.IsDBNull(reader.GetValue(23))) { expressInfo.ELEXPREMARK = reader.GetString(23); } if (!Convert.IsDBNull(reader.GetValue(24))) { expressInfo.ELOVERTIME = reader.GetString(24); } if (!Convert.IsDBNull(reader.GetValue(25))) { expressInfo.TFBUZSTATUS = reader.GetInt32(25); } if (!Convert.IsDBNull(reader.GetValue(26))) { expressInfo.EISENDERNAME = reader.GetString(26); } if (!Convert.IsDBNull(reader.GetValue(27))) { expressInfo.EISENDERPHONE = reader.GetString(27); } if (!Convert.IsDBNull(reader.GetValue(28))) { expressInfo.EITAKEUSERNAME = reader.GetString(28); } if (!Convert.IsDBNull(reader.GetValue(29))) { expressInfo.EITAKEUSERPHONE = reader.GetString(29); } return(expressInfo); }