Пример #1
0
        public bool AddZhuyuanInfo(ZhuyuanModel zhuyuanModel)
        {
            string sqlString = "insert into [t_zhuyuan] (name,sex,age,roomNo,arriveTime,isLeave,leaveTime,money,checkinOperator,checkoutOperator) values (";

            sqlString += SqlString.GetQuotedString(zhuyuanModel.getName()) + ",";
            sqlString += SqlString.GetQuotedString(zhuyuanModel.getSex()) + ",";
            sqlString += zhuyuanModel.getAge() + ",";
            sqlString += SqlString.GetQuotedString(zhuyuanModel.getRoomNo()) + ",";
            sqlString += "'" + zhuyuanModel.getArriveTime() + "',";
            sqlString += zhuyuanModel.getIsLeave() + ",";
            sqlString += "'" + zhuyuanModel.getLeaveTime() + "',";
            sqlString += zhuyuanModel.getMoney() + ",";
            sqlString += SqlString.GetQuotedString(zhuyuanModel.getCheckinOperator()) + ",";
            sqlString += SqlString.GetQuotedString(zhuyuanModel.getCheckoutOperator()) + ")";

            DataBase db = new DataBase();

            if (db.InsertOrUpdate(sqlString) < 0)
            {
                this.errMessage = "登记病人住院信息发生了错误!";
                return(false);
            }
            return(true);
        }