Ejemplo n.º 1
0
        public int Add(RepairModel beans)
        {
            // ผู้ทำรายการ
            // string format = "yyyy-MM-dd HH:MM:ss";
            string sql = "INSERT INTO REPAIR(CUST_NO,USER_NO,PRODUCT_NO,REP_STATUS_ID,MODEL,COLOR,DAMAGE,DATE_CONSIGN,DATE_ASSIGN,RECIPIENT_ID)";

            sql += "VALUES(" + beans.CUSTOMER.CUST_NO + "," + beans.STAFF.USER_NO + "," + beans.PRODUCT.PRODUCT_NO + "," + beans.STATUS.STATUS_ID + ",'" + beans.MODEL + "',"
                   + "'" + beans.COLOR + "','" + beans.DAMAGE + "','" + cv.strToDateTime(beans.DATE_CONSIGN.ToString()) + "','" + beans.DATE_ASSIGN + "','" + beans.RECIPIENT_ID.USER_NO + "');SELECT @@IDENTITY;";

            System.Diagnostics.Debug.WriteLine("REPAIR_DAO.ADD TEST SQL" + sql);
            return(db.add(sql));
        }