Ejemplo n.º 1
0
        public static ZhuyuanModel GetZhuyuanInfoById(int t_zhuyuan_id)
        {
            string       sqlString    = "select * from [t_zhuyuan] where t_zhuyuan_id=" + t_zhuyuan_id;
            DataBase     db           = new DataBase();
            DataSet      ds           = db.GetDataSet(sqlString);
            ZhuyuanModel zhuyuanModel = null;

            if (ds.Tables[0].Rows.Count > 0)
            {
                zhuyuanModel = new ZhuyuanModel();
                DataRow dr = ds.Tables[0].Rows[0];
                zhuyuanModel.setT_zhuyuan_id(t_zhuyuan_id);
                zhuyuanModel.setName(dr["name"].ToString());
                zhuyuanModel.setSex(dr["sex"].ToString());
                zhuyuanModel.setAge(Convert.ToInt32(dr["age"]));
                zhuyuanModel.setRoomNo(dr["roomNo"].ToString());
                zhuyuanModel.setArriveTime(Convert.ToDateTime(dr["arriveTime"]));
                zhuyuanModel.setIsLeave(Convert.ToInt32(dr["isLeave"]));
                zhuyuanModel.setLeaveTime(Convert.ToDateTime(dr["leaveTime"]));
                zhuyuanModel.setMoney(Convert.ToSingle(dr["money"]));
                zhuyuanModel.setCheckinOperator(dr["checkinOperator"].ToString());
                zhuyuanModel.setCheckoutOperator(dr["checkoutOperator"].ToString());
            }
            return(zhuyuanModel);
        }