示例#1
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public ZIT.AppRouteServer.Model.SendCarInfo DataRowToModel(DataRow row)
 {
     ZIT.AppRouteServer.Model.SendCarInfo model = new ZIT.AppRouteServer.Model.SendCarInfo();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["CASEID"] != null)
         {
             model.CASEID = row["CASEID"].ToString();
         }
         if (row["LSH"] != null)
         {
             model.LSH = row["LSH"].ToString();
         }
         if (row["CCCC"] != null && row["CCCC"].ToString() != "")
         {
             model.CCCC = int.Parse(row["CCCC"].ToString());
         }
         if (row["CLID"] != null)
         {
             model.CLID = row["CLID"].ToString();
         }
         if (row["CPH"] != null)
         {
             model.CPH = row["CPH"].ToString();
         }
         if (row["CCSJ"] != null && row["CCSJ"].ToString() != "")
         {
             model.CCSJ = DateTime.Parse(row["CCSJ"].ToString());
         }
         if (row["SSDW"] != null)
         {
             model.SSDW = row["SSDW"].ToString();
         }
         if (row["DRIVERPHONE"] != null)
         {
             model.DRIVERPHONE = row["DRIVERPHONE"].ToString();
         }
         if (row["DRIVERNAME"] != null)
         {
             model.DRIVERNAME = row["DRIVERNAME"].ToString();
         }
         if (row["DOCTORPHONE"] != null)
         {
             model.DOCTORPHONE = row["DOCTORPHONE"].ToString();
         }
         if (row["DOCTORNAME"] != null)
         {
             model.DOCTORNAME = row["DOCTORNAME"].ToString();
         }
     }
     return(model);
 }
示例#2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ZIT.AppRouteServer.Model.SendCarInfo GetModel()
        {
            //该表无主键信息,请自定义主键/条件字段
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ID,CASEID,LSH,CCCC,CLID,CPH,CCSJ,SSDW,DRIVERPHONE,DRIVERNAME,DOCTORPHONE,DOCTORNAME from SendCarInfo ");
            strSql.Append(" where ");
            OracleParameter[] parameters =
            {
            };

            ZIT.AppRouteServer.Model.SendCarInfo model = new ZIT.AppRouteServer.Model.SendCarInfo();
            DataSet ds = DbHelperOra.Query("", strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }